Dynamic Tool Loading
Fp Switchboard offers 996+ tools across 32 services. Loading all of them into an AI session at once consumes 40-60K tokens of context window — often causing errors. Dynamic tool loading solves this.
The Problem
Section titled “The Problem”When connecting to the unified endpoint (/mcp/unified), all tools load at connection time:
| Mode | Tools Loaded | Context Usage | Risk |
|---|---|---|---|
| Standard | ~996 | ~40-60K tokens | Compaction errors, degraded performance |
| Dynamic | 3 meta-tools | ~1.5K tokens | None |
How It Works
Section titled “How It Works”Add ?dynamic=true to your unified endpoint URL:
https://api.switchboard.fpdigital.ai/mcp/unified?dynamic=trueInstead of 996+ tool schemas, your AI receives 3 lightweight meta-tools:
Meta-Tools
Section titled “Meta-Tools”| Tool | Purpose | Returns |
|---|---|---|
unified_list_services | List available services | Service names, tool counts, connection status |
unified_get_tools | Get tools for one service | Full tool schemas for the requested service |
unified_call_tool | Execute any tool | Proxies the call to the actual service tool |
Typical Flow
Section titled “Typical Flow”- AI connects and receives 3 meta-tools (~1.5K tokens)
- User asks: “Check my Gmail inbox”
- AI calls
unified_list_servicesto see Google is connected - AI calls
unified_get_toolswithservice: "google"to get Gmail tools - AI calls
unified_call_toolwithtool: "gmail_search"and the parameters
Claude.ai Web: Deferred Loading
Section titled “Claude.ai Web: Deferred Loading”Claude.ai web connections automatically use deferred loading — a complementary approach:
- All tool names are sent, but schemas are deferred (
defer_loading: true) - Claude fetches full schemas on-demand via
tools/getwhen it needs them - Works with Claude’s built-in Tool Search feature
- ~95% token reduction compared to standard loading
When to Use Each Mode
Section titled “When to Use Each Mode”| Scenario | Recommendation |
|---|---|
| Claude Desktop with all services | ?dynamic=true on unified endpoint |
| Claude.ai web | Automatic deferred loading (just connect) |
| Single service (e.g., just Gmail) | Per-service endpoint: /mcp/google |
| Curated tool set | Custom Bundle with selected tools |
| Cursor / VS Code | ?dynamic=true or per-service endpoints |
Configuration
Section titled “Configuration”Claude Desktop
Section titled “Claude Desktop”{ "mcpServers": { "fp-switchboard": { "command": "npx", "args": ["-y", "@anthropic-ai/mcp-remote", "https://api.switchboard.fpdigital.ai/mcp/unified?dynamic=true"], "env": { "MCP_HEADERS": "authorization:Bearer fps_unified_YOUR_TOKEN" } } }}Claude Code / Cursor
Section titled “Claude Code / Cursor”Use the same URL with ?dynamic=true in your MCP server configuration.
Comparison
Section titled “Comparison”| Feature | Standard | Dynamic | Deferred | Bundle |
|---|---|---|---|---|
| Token usage | ~60K | ~1.5K | ~3K | Varies |
| All tools available | Yes | Yes (on demand) | Yes (on demand) | Selected only |
| Extra API calls | 0 | 2-3 per task | 1 per tool | 0 |
| Best for | Small tool sets | Full access, low context | Claude.ai web | Focused workflows |