MetorialDocs

Limit which MCP tools an agent sees 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

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

On the integration

Open Tool Filters

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

Reject whole categories

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

Pick single tools

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

From the CLI, pass an allowlist of tool keys:

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

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.

Choose tools

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

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.

{
  "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:

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