# tools()

Canonical URL: https://developers.iagenify.com/sdk/ref/mcp/tools/
Language: en

`api.mcp.tools(names?) → Promise<Declaration[]>`

The allowed tools of those servers, as declarations ready for models.turn({ tools }). For anyone writing their own loop — MCP does not depend on our engine.

Status: ready for turn() · sanitised · names are prefixed

```javascript
const tools = await api.mcp.tools(["example"]);
// [{ name: "example_search_docs", description: "…", parameters: { … } }]

const turn = await api.models.turn({
  model: "gemini-3.5-flash",
  messages: [{ role: "user", content: "Find the retry policy." }],
  tools,
});
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `names` | string[]|null | all connected | Which servers. `[]` returns nothing. |

## Names carry the server {#prefixed}

`example_search_docs` — two servers can both offer `search`, and a third-party tool must never be able to take the name of one of ours. The name is trimmed to 64 characters.

## The schemas are sanitised {#sanitised}

> **This is not a precaution, it is required**
>
> A provider refuses a raw MCP schema — a reference, an unusual construct — and fails the whole turn, not just that tool. One third-party server could break every answer. sanitizeSchema() reduces each one to what providers understand, and a schema with no usable type becomes a string parameter rather than a tool that cannot be declared at all.

## No tokens in it {#no-token}

Declarations only. To actually run one, call [api.mcp.call()](/sdk/ref/mcp/call), which reads the connection itself.

## Against giving them to an agent {#versus}

|  | tools() + your loop | agents.create({ mcp }) |
| --- | --- | --- |
| Who runs the round trip | you | the engine |
| Permission per call | yours to build | the category, through `onPermission` |
| Budget | yours | counted and enforced |
| Works on | any provider | any provider |

- [models.turn()](/sdk/ref/models/turn): Where these go.
- [forAgent()](/sdk/ref/mcp/for-agent): The engine's own version.
- [api.mcp](/sdk/ref/mcp): Connecting, listing and using a server.

```python
tools = api.mcp.tools(["example"])
# [{"name": "example_search_docs", "description": "…", "parameters": {…}}]

turn = api.models.turn(
    model="gemini-3.5-flash",
    messages=[{"role": "user", "content": "Find the retry policy."}],
    tools=tools,
)
```
