# call()

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

`api.mcp.call(name, tool, args, { signal? }) → Promise<Result>`

Run one of a server's tools without an agent — to check a connection, or because you are writing your own loop.

Status: no agent · 60 s · no permission callback

```javascript
const result = await api.mcp.call("example", "search_docs", { query: "retry policy" });
console.log(result);
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `name` | string | required | The server. |
| `tool` | string | required | The tool, as the server names it. |
| `args` | object | {} | Its arguments. |
| `signal` | AbortSignal |  | Cancels the call. |

## What it does {#what-happens}

Reads the connection, shakes hands, and calls the tool — carrying the header annotations the server's own schema asked for. The result is the server's output, clipped at 60 000 characters with a note saying how much was left out.

## There is no permission callback here {#no-permission}

> **This is your call, not an agent's**
>
> The category decides what an agent is asked about; calling it yourself bypasses that entirely, because you are the one deciding. Do not route a model's choice through this — give the model the tool through an agent, where the category applies.

## It is not bound by the allowed list {#allowed}

The allowed list decides what is *declared to a model*. Calling a tool yourself is a decision you have already made — which is what makes this useful for checking a tool before allowing it.

## Sixty seconds {#timeout}

A call has a 60-second ceiling, and listing tools 30. A server that goes quiet raises `mcp_timeout` rather than holding a run open.

## Writing your own loop {#own-loop}

```javascript
const tools = await api.mcp.tools(["example"]);
const turn = await api.models.turn({ model: "gemini-3.5-flash", messages, tools });

for (const call of turn.message.toolCalls ?? []) {
  const [server, tool] = splitYourWay(call.name);
  const output = await api.mcp.call(server, tool, call.args);
  // feed it back as a tool message
}
```

- [tools()](/sdk/ref/mcp/tools): The declarations for your loop.
- [Errors](/sdk/mcp/errors): What a failure means.
- [api.mcp](/sdk/ref/mcp): Connecting, listing and using a server.

```python
result = api.mcp.call("example", "search_docs", {"query": "retry policy"})
print(result)
```

```python
tools = api.mcp.tools(["example"])
turn = api.models.turn(model="gemini-3.5-flash", messages=messages, tools=tools)

for call in turn["message"].get("toolCalls") or []:
    server, tool = split_your_way(call["name"])
    output = api.mcp.call(server, tool, call["args"])
    # feed it back as a tool message
```
