Summary
Hermes Agent v0.11.0 sends the full schema of every registered MCP tool on every API call, regardless of relevance to the current turn. With multiple MCP servers connected, this becomes a significant fraction of every prompt.
Anthropic shipped Tool Search Tool (beta) precisely to solve this: tools marked defer_loading: true are not loaded into the model context until the model actively searches for them. The feature is supported across Anthropic API, Bedrock, Vertex AI, and Azure (i.e. all paths Hermes already uses).
This issue requests Hermes config support to opt MCP tools into Tool Search.
Why this matters (numbers)
Concrete sample
A real Hermes deployment (5 MCP servers, 34 tools total, mostly Haiku 4.5 via Bedrock) shows average prompt size 45K tokens/turn, of which ~22K is tool schema overhead (≈50%). Cache miss generations (start of session) cost $0.07-$0.10; cache hits cost $0.007. Tool Search would shrink the schema portion of the cache miss without affecting the rest of the prompt.
Proposed config surface
In ~/.hermes/config.yaml:
mcp_servers:
vault-bridge:
transport: streamable-http
url: http://...:3142/mcp
defer_loading: true # NEW: marks all tools from this server as defer_loading=true
cve-lookup:
transport: stdio
command: /usr/bin/node
args: [...]
defer_loading: true
# OR per-tool override:
tool_overrides:
cve_lookup: { defer_loading: false } # always-loaded for hot tools
agent:
tool_search:
enabled: true
variant: bm25 # bm25 | regex
# When enabled, Hermes adds the tool_search_tool definition to the tools array
# and sends the `anthropic-beta: advanced-tool-use-2025-11-20` header on Anthropic-family providers
Implementation notes
- Header propagation: pass
anthropic-beta: advanced-tool-use-2025-11-20 on Anthropic, Bedrock, Vertex, Azure paths. Skip on non-Anthropic providers (graceful degradation — Hermes already supports fallback model logic).
tool_search_tool injection: when agent.tool_search.enabled: true, prepend the synthetic {"type": "tool_search_tool_bm25_20251119"} (or regex variant) to the tools array.
- Defer flag: when serializing each MCP-discovered tool to the API request, include
defer_loading: <bool> as configured.
- Beta MCP header: also requires
mcp-client-2025-11-20 per Anthropic docs.
- Backward compat: default
tool_search.enabled: false, defer_loading: false — opt-in only. Existing deployments unchanged.
Related issues
References
Acceptance criteria
Summary
Hermes Agent v0.11.0 sends the full schema of every registered MCP tool on every API call, regardless of relevance to the current turn. With multiple MCP servers connected, this becomes a significant fraction of every prompt.
Anthropic shipped Tool Search Tool (beta) precisely to solve this: tools marked
defer_loading: trueare not loaded into the model context until the model actively searches for them. The feature is supported across Anthropic API, Bedrock, Vertex AI, and Azure (i.e. all paths Hermes already uses).This issue requests Hermes config support to opt MCP tools into Tool Search.
Why this matters (numbers)
Concrete sample
A real Hermes deployment (5 MCP servers, 34 tools total, mostly Haiku 4.5 via Bedrock) shows average prompt size 45K tokens/turn, of which ~22K is tool schema overhead (≈50%). Cache miss generations (start of session) cost $0.07-$0.10; cache hits cost $0.007. Tool Search would shrink the schema portion of the cache miss without affecting the rest of the prompt.
Proposed config surface
In
~/.hermes/config.yaml:Implementation notes
anthropic-beta: advanced-tool-use-2025-11-20on Anthropic, Bedrock, Vertex, Azure paths. Skip on non-Anthropic providers (graceful degradation — Hermes already supports fallback model logic).tool_search_toolinjection: whenagent.tool_search.enabled: true, prepend the synthetic{"type": "tool_search_tool_bm25_20251119"}(or regex variant) to the tools array.defer_loading: <bool>as configured.mcp-client-2025-11-20per Anthropic docs.tool_search.enabled: false,defer_loading: false— opt-in only. Existing deployments unchanged.Related issues
list_prompts/get_prompt/list_resources/read_resource) are registered even when the server doesn't advertise the corresponding capabilities #18051 — MCP utility stubs registered even when server doesn't advertise capabilities. Tool Search reduces the cost of those stubs being present.References
Acceptance criteria
mcp_servers.<name>.defer_loading(bool) accepted and propagated to all tools from that servermcp_servers.<name>.tool_overrides.<tool>.defer_loading(bool) optional per-tool overrideagent.tool_search.enabled: trueinjectstool_search_tool_bm25_20251119andadvanced-tool-use-2025-11-20header on Anthropic-family providersdocs/user-guide/features/tools/