# call()

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

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

运行服务器工具之一, 不带代理器 , 检查连接, 或者因为您正在撰写自己的循环 。

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 | 必填 | 服务器 |
| `tool` | string | 必填 | 服务器命名的工具 。 |
| `args` | object | {} | 其论点。 |
| `signal` | AbortSignal |  | 取消电话 |

## 它可以做什么 {#what-happens}

读取连接、握手和拨打工具—— 携带服务器自己所要求图案的标题说明。 结果显示服务器输出, 剪切了6万个字符, 并写着有多少被遗漏。

## 这里没有回回回权限 {#no-permission}

> **这是你的决定,不是探员的**
>
> 类别决定了代理被问到什么; 自己称它为完全绕过这个, 因为决定者是你。 不要通过这个选择选择模式, 给模型工具以代理, 并在此类别适用的地方 。

## 它不受允许清单的约束 {#allowed}

允许的清单决定 *向模型申报*自己使用工具是您已经做出的决定,因此,在允许之前,这有利于检查工具。

## 60秒 {#timeout}

电话有60秒上限,列出30个工具 静静升升升的服务器 `mcp_timeout` 而不是保持运行打开。

## 自己写自编环环 {#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()](/zh/sdk/ref/mcp/tools): 您循环的申报 。
- [错误](/zh/sdk/mcp/errors): 失败意味着什么?
- [api.mcp](/zh/sdk/ref/mcp): 连接、列出和使用服务器。

```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
```
