Discovery Tools

Discover tools, plan workflows, explore capabilities, and execute tool calls across your integration mesh.

Discovery tools let your agents find tools by describing what they need in natural language, build verified multi-step plans, and navigate available capabilities interactively. All four tools are available on every server at data-grout@1/discovery.*@1.


discovery.discover@1

Search for tools semantically. Describe what you want to accomplish, and Discover returns ranked matches from your integration mesh.

You can also pass an array of queries to search in batch. Each query runs independently and returns its own result set.

Parameters

Parameter Type Required Default Description
goal string yes – Natural language description of what you want to accomplish
limit integer no 10 Maximum number of results to return
min_score number no 0 Minimum relevance score (0–1). Results below this threshold are excluded
coverage_gaps boolean no false Include analysis of what tools are missing to fully achieve the goal
integrations array no all Filter results to specific integrations (e.g. ["salesforce", "quickbooks"])
servers array no current Search across specific servers by UUID. Defaults to the current server only
demux boolean no false Include tools from demuxable servers in search results

Example

{
  "name": "data-grout@1/discovery.discover@1",
  "arguments": {
    "goal": "find customers with unpaid invoices",
    "limit": 5,
    "integrations": ["quickbooks"]
  }
}

Response:

{
  "query_used": "find customers with unpaid invoices",
  "results": [
    {
      "tool": {
        "name": "quickbooks@1/list_invoices@1",
        "description": "List invoices filtered by status, customer, or date range",
        "inputSchema": { "..." : "..." }
      },
      "score": 0.91
    },
    {
      "tool": {
        "name": "quickbooks@1/get_customer@1",
        "description": "Get a customer record by ID",
        "inputSchema": { "..." : "..." }
      },
      "score": 0.74
    }
  ]
}

Batch search

Pass an array to search multiple goals in one call:

[
  { "goal": "get leads from CRM", "limit": 3 },
  { "goal": "create an invoice", "limit": 3 }
]

Returns an array of result sets, one per query.


discovery.plan@1

Build a verified multi-step workflow for a goal. The planner searches your tool graph, inserts type adapters where needed, and validates the result before returning it. Plans come with a Cognitive Trust Certificate confirming they are cycle-free, type-safe, and policy-compliant.

Parameters

Parameter Type Required Default Description
goal string yes – Natural language description of the workflow goal
query string no – Alternative to goal for shorter search-style queries
k integer no 5 Number of candidate plans to evaluate
policy object no server default Policy overrides: max_cost, read_only, allowed_integrations
have object no – Data you already have that the plan can use as input
return_call_handles boolean no true Include callable handles for each step so you can execute them directly
expose_virtual_skills boolean no true Surface saved skills that match the goal alongside tool-based plans

Example

{
  "name": "data-grout@1/discovery.plan@1",
  "arguments": {
    "goal": "Create QuickBooks invoices from qualified Salesforce leads",
    "policy": { "max_cost": 100 }
  }
}

Response:

{
  "plan_id": "plan_abc123",
  "steps": [
    {
      "step": 1,
      "tool": "salesforce@1/get_leads@1",
      "args": { "status": "Qualified" },
      "output_type": "crm.lead@1"
    },
    {
      "step": 2,
      "tool": "data-grout@1/prism.focus@1",
      "args": { "source_type": "crm.lead@1", "target_type": "billing.customer@1" },
      "output_type": "billing.customer@1"
    },
    {
      "step": 3,
      "tool": "quickbooks@1/create_invoice@1",
      "args": { "customer": "$step2.result" },
      "output_type": "billing.invoice@1"
    }
  ],
  "estimated_cost": 45,
  "safe": true,
  "ctc_id": "ctc_xyz789"
}

Use the returned plan_id to execute the plan, or inspect individual steps using the call handles.


discovery.guide@1

Navigate your integration mesh interactively. Guide presents options at each step, you choose, and the system narrows down until it reaches a concrete tool or workflow. Guide maintains session state across calls, so you can go back and explore different branches.

Parameters

Parameter Type Required Default Description
query / goal string yes (first call) – What you want to accomplish. Required on the first call; optional on subsequent calls within the same session
session_id string no – Session identifier returned from a previous Guide call. Pass this to continue the conversation
choice string no – Your selection from the options presented in the previous response
back boolean no false Go back one step in the current session
save_as_skill boolean no false Save the completed workflow as a reusable skill

Example

First call:

{
  "name": "data-grout@1/discovery.guide@1",
  "arguments": {
    "goal": "sync data between my CRM and billing system"
  }
}

Response:

{
  "session_id": "guide_abc123",
  "message": "What kind of data do you want to sync?",
  "options": [
    { "label": "Customers / Contacts", "value": "customers" },
    { "label": "Invoices / Bills", "value": "invoices" },
    { "label": "Products / Items", "value": "products" }
  ]
}

Follow-up call:

{
  "name": "data-grout@1/discovery.guide@1",
  "arguments": {
    "session_id": "guide_abc123",
    "choice": "customers"
  }
}

The system continues narrowing until it reaches a concrete plan or tool. At that point you can execute directly or save the result as a skill.


discovery.perform@1

Execute a tool by name. Perform is the execution layer: you specify a tool and its arguments, and it runs. You can also pass an array to execute multiple tools in parallel, or enable demux to broadcast a call across compatible servers.

Perform also supports inline data transformation (refract) and chart generation (chart) on the result.

Parameters

Parameter Type Required Default Description
tool string yes – Full tool name (e.g. salesforce@1/get_leads@1)
args object yes – Arguments to pass to the tool
skill_handle string no – Execute a saved skill instead of a raw tool
inputs object no – Input data for skill execution
save_as_skill boolean no false Save this execution as a reusable skill
demux boolean no false Broadcast this call across all servers with a compatible tool
demux_mode string no "strict" "strict" requires exact tool name match; "fuzzy" matches semantically compatible tools
refract string no – Natural language transformation to apply to the result
chart string no – Generate a chart from the result (e.g. "bar chart of revenue by month")

Example: single call

{
  "name": "data-grout@1/discovery.perform@1",
  "arguments": {
    "tool": "salesforce@1/get_leads@1",
    "args": { "status": "Qualified", "limit": 10 }
  }
}

Example: batch execution

[
  { "tool": "salesforce@1/get_leads@1", "args": { "limit": 10 } },
  { "tool": "quickbooks@1/list_invoices@1", "args": { "status": "unpaid" } }
]

Example: demux write

{
  "name": "data-grout@1/discovery.perform@1",
  "arguments": {
    "tool": "quickbooks@1/create_invoice@1",
    "args": { "customer_id": "cust_123", "amount": 500 },
    "demux": true,
    "demux_mode": "strict"
  }
}

Returns results from every server that has a matching tool:

{
  "mode": "strict",
  "results": [
    { "server_name": "Production", "success": true, "result": { "..." : "..." } },
    { "server_name": "Staging", "success": true, "result": { "..." : "..." } }
  ],
  "total_targets": 2,
  "successful": 2
}

When to use which tool

Situation Tool
You know what you want but not which tool does it discover
You need a multi-step workflow with guarantees plan
You want to explore what’s possible interactively guide
You know the exact tool and want to run it perform