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

# Tool Permissions

> Each key or team names the MCP servers, tools, and agents it may use.

Each [key](https://developers.telnyx.com/docs/agent-gateway/authentication/keys.md) or [team](https://developers.telnyx.com/docs/agent-gateway/authorization/allow-lists.md#teams) names the MCP servers and tools it may use, and the agents it may reach. The gateway hides everything else from the agent and refuses requests for it.

## MCP Servers

A key reaches the [MCP servers and APIs](https://developers.telnyx.com/docs/agent-gateway/targets/tools.md) granted to it or to its team, and the servers open to every key. When both the key and its team have a grant, the key reaches only the servers and tools in both. A key with no grant from either reaches only the servers open to every key.

[`PUT /v2/agent_gateways/{id}/keys/{key_id}/tool_permissions`](https://developers.telnyx.com/api-reference/agent-gateway-tool-permissions/set-a-keys-tool-permissions) replaces a key's grant, and the same path under a team replaces the team's. Each entry names a server by its `id`:

```json theme={null}
{
  "servers": [
    { "id": "88d5a97b-4080-4855-8bac-a39811b1dc24", "tools": ["get_order"] }
  ]
}
```

`tools: []` grants every tool the server exposes, and `servers: []` grants none.

`tools/list` returns the tools of the servers the key reaches, and no others. A changed grant reaches the instance within a minute.

## Tools

Within a server, a grant can name some of its tools. A server can also expose only some of its tools to every key, in its own `tools`.

The gateway refuses a `tools/call` request for a tool outside these limits, and the request never reaches the server. The agent gets an error result in place of the tool's result.

## Agents

A key or team can name the agents Planned it may reach. A key reaches every agent on the instance until it or its team names some. When both name agents, the key reaches only the agents in both. The gateway refuses requests to any other agent.
