Skip to content

Feature request: Tool filtering via --include-tools or env var #58

@mattharvill

Description

@mattharvill

Problem

When this MCP server connects, it exposes all 17 tools to the client. Each tool includes a full JSON schema with parameter definitions, descriptions, and validation rules. This consumes ~13,000 tokens before the user types anything.

User Journey

  1. User opens Claude Code in VS Code
  2. MCP server connects and sends all 17 tool schemas
  3. Claude's context window is now 6.5% consumed - just from this one server
  4. User also has Google Calendar MCP (~15k tokens) and Todoist (~3k tokens)
  5. Total: ~32k tokens consumed before any conversation begins
  6. User hits context limits faster, requiring more /clear commands
  7. Session continuity suffers; user loses conversation history more frequently

The Reality

Most users need 3-4 tools for their daily workflow:

  • get_sheet_data - read from spreadsheets
  • update_cells - write to spreadsheets
  • list_spreadsheets - find spreadsheets
  • list_sheets - navigate tabs

But they pay for all 17:

  • get_sheet_formulas, batch_update_cells, batch_update, add_rows, add_columns, copy_sheet, rename_sheet, get_multiple_sheet_data, get_multiple_spreadsheet_summary, create_spreadsheet, create_sheet, share_spreadsheet, list_folders

The unused tools aren't free - they consume context that could be used for actual work.

Proposed Solution

Add a --include-tools flag or ENABLED_TOOLS environment variable:

{
  "mcpServers": {
    "google-sheets": {
      "command": "uvx",
      "args": ["mcp-google-sheets", "--include-tools", "get_sheet_data,update_cells,list_spreadsheets,list_sheets"],
      "env": {
        "SERVICE_ACCOUNT_PATH": "/path/to/credentials.json"
      }
    }
  }
}

Or via env var:

  {
    "env": {
      "ENABLED_TOOLS": "get_sheet_data,update_cells,list_spreadsheets,list_sheets"
    }
  }

Implementation Notes

This would require modifying the tools/list handler to filter against an allowlist before returning. The change is minimal - a simple array filter on the tool registry.

Workaround Today

None without forking the repository and maintaining a custom version.

Context

This is a recognized problem in the MCP ecosystem. Anthropic's engineering team has documented tool definition bloat consuming 55K-134K tokens before conversations begin. Their Advanced Tool Use guidance recommends solutions like on-demand tool discovery to reduce context overhead

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions