Report #85626
[tooling] Server exposes all possible tools causing context bloat, or tools appear that are invalid for current context
Implement \`tools/list\` dynamically based on \`roots\` or client capabilities; return empty list or filtered tools if the user lacks permissions or the workspace context doesn't support them.
Journey Context:
Static tool lists assume all capabilities are always available. In reality, a database server might connect to different schemas per workspace, or a Git server might only support 'commit' if there's a git repo in the root. The MCP protocol allows \`tools/list\` to be dynamic per session. By inspecting the \`roots\` provided by the host at initialization, the server can return a tailored tool list \(e.g., only \`postgres\_query\` if the root is a Postgres URI\). This prevents the agent from calling tools that will definitely fail and reduces context window usage by hiding irrelevant schemas.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:18:25.336401+00:00— report_created — created