> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyreach.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools and discovery

> The four meta-tools and the discover-then-call workflow.

The Anyreach MCP server does not expose one tool per API operation. Instead it exposes four meta-tools that let an LLM client discover any operation in the Anyreach API surface and then invoke it. Use the discovery tools to find the operation you want, fetch its input schema, and call it.

Every Anyreach API operation is named `{service}_{operationId}`, for example `core_list_agents`. The service prefix is one of `core`, `workflow`, `knowledge_base`, `campaign`, or `admin`, and the rest comes from the operation's `operationId`.

## The four meta-tools

| Tool             | Purpose                                    | Returns                                                         |
| ---------------- | ------------------------------------------ | --------------------------------------------------------------- |
| `list_all_tools` | List every operation by name.              | Name and one-line description only.                             |
| `search_tools`   | Find operations by natural-language query. | Top matches, each with its input schema inline.                 |
| `describe_tool`  | Get full metadata for one operation.       | Service, method, path, tags, and a fully resolved input schema. |
| `call_tool`      | Invoke an operation.                       | The upstream JSON response.                                     |

### list\_all\_tools()

Lists every tool exposed by the server. Each entry is `name` plus a one-line `description` only, with no input schema. Use it to browse the full catalog, then call `describe_tool(name)` to get the schema for a specific tool.

```json theme={null}
[
  { "name": "core_list_agents", "description": "List agents" },
  { "name": "core_create_agent", "description": "Create agent" }
]
```

### search\_tools(query, limit=10)

Finds operations relevant to a natural-language `query` and returns the top matches, defaulting to `limit=10`. Unlike `list_all_tools`, each result carries its input schema inline, so a result is ready to invoke via `call_tool` without an extra round trip.

<Note>
  The schema returned inline by `search_tools` keeps its `$ref` references unresolved to keep responses small. If you need a fully inlined schema before calling, fall back to `describe_tool`.
</Note>

```json theme={null}
[
  {
    "name": "core_list_agents",
    "description": "List agents",
    "inputSchema": {
      "type": "object",
      "properties": { "limit": { "type": "integer" } }
    }
  }
]
```

### describe\_tool(name)

Fetches the full metadata and JSON Schema for a single operation by `name`. Use it after `list_all_tools` once you have picked a tool and need its input schema before calling it. Unlike `search_tools`, the returned `inputSchema` has every referenced component schema inlined under `$defs`.

The response includes:

| Field                | Description                                                                       |
| -------------------- | --------------------------------------------------------------------------------- |
| `name`               | The `{service}_{operationId}` tool name.                                          |
| `description`        | One-line summary of the operation.                                                |
| `service`            | The owning service: `core`, `workflow`, `knowledge_base`, `campaign`, or `admin`. |
| `method`             | HTTP method, for example `GET` or `POST`.                                         |
| `path`               | The operation path, for example `/agents/{agent_id}`.                             |
| `tags`               | OpenAPI tags for the operation.                                                   |
| `inputSchema`        | The fully resolved JSON Schema for the call arguments.                            |
| `unsupported_reason` | Set when the operation cannot be called via MCP, otherwise null.                  |

Passing an unknown `name` raises an error pointing you back to `list_all_tools` or `search_tools`.

### call\_tool(name, arguments, organization\_id)

Invokes an Anyreach API operation by `name` and returns the upstream JSON response.

* `arguments` must conform to the operation's `inputSchema`. Path, query, and header parameters are top-level keys; the request body goes under an `arguments.body` field.
* `organization_id` is the Anyreach organization to act on behalf of. Pass it when the operation is org-scoped, which most are.

```json theme={null}
{
  "name": "core_create_agent",
  "organization_id": "org_123",
  "arguments": {
    "body": { "name": "Support agent" }
  }
}
```

<Warning>
  Upstream errors surface back to the client. If the downstream service returns a `401` mentioning a missing organization claim, retry with `organization_id` set. Unknown tool names raise an error directing you to the discovery tools.
</Warning>

## Recommended flow

Discover the operation, fetch its schema, then call it.

<Steps>
  <Step title="Search or list">
    Use `search_tools("create an agent")` to find candidate operations by intent, or `list_all_tools()` to browse the full catalog.
  </Step>

  <Step title="Describe">
    Call `describe_tool(name)` to get the fully resolved input schema and metadata for the operation you picked. Skip this if `search_tools` already returned a schema you can satisfy.
  </Step>

  <Step title="Call">
    Call `call_tool(name, arguments, organization_id)` with arguments that conform to the schema. The request body goes under `arguments.body`.
  </Step>
</Steps>

```text theme={null}
search_tools / list_all_tools  ->  describe_tool  ->  call_tool
        (find the operation)        (get schema)       (invoke)
```

## Related

<CardGroup cols={2}>
  <Card title="Coverage and limits" icon="list-check" href="/mcp/coverage-and-limits">
    Which operations are exposed and what is not callable via MCP.
  </Card>

  <Card title="Connecting a client" icon="plug" href="/mcp/connecting-a-client">
    Point an MCP client at the Anyreach server and authenticate.
  </Card>
</CardGroup>
