# Allowed tools

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

Nothing is allowed until you say so. Not caution — arithmetic: a declaration costs tokens on every turn of every run.

Status: none by default · chosen per connection · the cost is per turn

## The arithmetic {#arithmetic}

> **Every allowed tool is sent with every turn**
>
> A server offering ninety tools, all allowed, adds a large fixed cost to each step of every run that uses it — paid by the account holder, on every answer, whether or not a single one is ever called.

That is why the default is none and why the choice is made at the connection rather than at the run: it is a decision about what the account pays for continuously.

## Choosing them {#choosing}

```javascript
// At connection
await api.mcp.connect({ url, name: "example", tools: ["search_docs", "get_issue"] });

// Later — the list is replaced, not added to
const server = await api.mcp.get("example");
const allowed = server.tools.filter((t) => t.allowed).map((t) => t.name);
await api.mcp.update("example", { tools: [...allowed, "create_issue"] });
```

## Watching the total {#watching}

```javascript
const servers = await api.mcp.list();
const perTurn = servers.reduce((n, s) => n + s.allowed, 0);
console.log(perTurn, "MCP tools declared on every turn");
```

## New tools arrive disallowed {#new-tools}

Refreshing a server brings in whatever it has added, with `allowed: false`. A server cannot widen its own surface by shipping more tools.

## Turning a server off {#off}

`tools: []` keeps the connection and its token and declares nothing. Reversible, and it costs nothing in the meantime.

## Narrow beats complete {#narrow}

Three well-chosen tools make a better agent than ninety: the model reads every description on every turn, and a long list of near-identical names is a reason to pick the wrong one.

- [update()](/sdk/ref/mcp/update): Changing the list.
- [Options · tools and library](/sdk/ref/agents/options/tools): The same arithmetic for built-in tools.

```python
# At connection
api.mcp.connect(url=url, name="example", tools=["search_docs", "get_issue"])

# Later — the list is replaced, not added to
server = api.mcp.get("example")
allowed = [t["name"] for t in server["tools"] if t["allowed"]]
api.mcp.update("example", tools=[*allowed, "create_issue"])
```

```python
servers = api.mcp.list()
per_turn = sum(s["allowed"] for s in servers)
print(per_turn, "MCP tools declared on every turn")
```
