> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Limit which MCP tools an agent sees to keep context small
URL: https://metorial.com/docs/platform/guides/limit-tools-to-keep-context-small

Trim the tool list in three places: Tool Filters on the integration, the tools each person selects per client, and tool_filters on API sessions.

---

Every tool definition takes space in the model's context. Trim the list in three places: admins set **Tool Filters** on the integration, each person picks integrations and tools per client at sign-in, and developers set `tool_filters` on API sessions. Filtered tools are never sent to the client.

**What you'll learn**

* How to cut an integration down to the tools a team uses
* How a person sets a different tool set for each client
* How to filter tools for an agent built on the API

**Before you start**

* An integration shared with you or your team
* For the CLI steps, [install the CLIs and sign in](https://metorial.com/docs/build/sandboxes#install-the-tools)

Admins set the outer limit. A person can narrow it for one client and cannot widen it.

## On the integration

### 1. Open Tool Filters

In the dashboard, open **Integrations**, then **Integrations**, select the integration, and open **Tool Filters**.

### 2. Reject whole categories

Switch the grouping from **Access** to **Category**. Set categories the team never uses to **Reject**.

### 3. Pick single tools

Set a category to **Mixed** and select only the tools you want.

From the CLI, pass an allowlist of tool keys:

```bash
metorial-admin integrations providers list --integration-id <integration-id>
metorial-admin integrations providers update <integration-provider-id> \
  --body '{"tool_filters":{"type":"tool_keys","keys":["list_issues","get_issue"]}}'
```

## Per client

### 1. Choose integrations at sign-in

When a person connects a client to the Magic MCP URL, Metorial's consent screen lists their integrations. They select only the ones this client needs.

### 2. Choose tools

For each integration, **Tool Access** offers "Allow every tool, including ones added later, or pick specific tools."

### 3. Change it later

In the portal, open the connected client, change **Tool access** for an integration to no access, all tools, or a selected subset, and select **Save integrations**.

A client set to specific tools does not pick up tools a provider adds later.

## On an API session

Set the filter on each provider when you create the session. Omitting `tool_filters` allows every tool of that provider.

```json
{
  "providers": [
    {
      "provider_deployment_id": "pdp_def456",
      "tool_filters": {
        "type": "tool_keys",
        "keys": ["send_message", "list_channels"]
      }
    }
  ]
}
```

## Check it worked

A person lists the tools of one of their integrations:

```bash
metorial list
metorial tools <integration-id>
```

AI clients cache the tool list, so reconnect the server or start a new conversation before you list the tools there.

Metorial sends the same filtered list for the whole connection and does not pick tools per request. Some clients load tools on demand themselves.

## Next steps

* [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): how tools are classified and filtered
* [Block destructive tools](https://metorial.com/docs/platform/guides/block-destructive-tools): remove risky tools for everyone
* [Sessions](https://metorial.com/docs/build/operate/sessions): providers and tool filters on API sessions