Don't show banned MCP tools to the model (context + behavior optimization)

Resolved 💬 4 comments Opened Aug 29, 2025 by art-shen Closed Jan 5, 2026

Imagine you have a few MCP servers with several tools.
Often, you may find some of these tools to be useless or undesirable. Sometimes, you may only need one or two tools from the large list available on an MCP server.

At the same time, we configured a deny list in permissions, which allowed us to ban the use of MCP tools. However, the model could still see these banned tools on a list. This pollutes the context, and sometimes the agent would persistently try to use a banned tool.

I propose checking the current configuration of permissions, where we have deny rules for different tools

If you see MCP tools banned (with exact or pattern matching + not on allow list)
do not show these tools to the model at all.

  1. This would prevent the model from exhibiting inefficient behavior when it tries to launch a tool and immediately receives a response that tool usage is denied.
  2. It would also prevent context pollution and allow people to control and use the MCP services much more efficiently when they only need a few tools instead of many unwanted ones.

---

For example:

{
  "permissions": {
    "allow": [
      "mcp__deepwiki__ask_question",
      "mcp__jetbrains__get_file_problems",
    ],
    "deny": [
      "mcp__jetbrains__*",
      "mcp__deepwiki__*"
    ],
  },
}

Here I would expect all JetBrains and DeepWiki MCP servers tools to be hidden from the model here, except for the two explicitly allowed tools.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗