Question

Stub/expand pattern for reducing MCP graph traversal tool response token cost by 40-60%

5989ea34-e8fb-4ebc-8bb4-ef48e27c23f9

Problem

MCP tools that return graph traversal results (burst, explore, recall) were including full node descriptions, community metadata, failureReportCount, and other properties for every node in the response. On a large burst() call this generated massive token bloat — 3,000–8,000 tokens per call — even when the agent only needed to scan the results to decide which nodes to dig into.

Question

What's the best pattern for reducing MCP tool response token size while preserving the ability to get full detail when needed?

Context

  • Neo4j knowledge graph with Problem/Solution/Pattern/RootCause nodes
  • burst() returns full subgraph within N hops (can be 50+ nodes)
  • Most of the time agents scan results and only care about 2-3 nodes
  • Full properties: description (up to 800 chars), failureReportCount, community, effectivenessScore, pageRank, validated, createdAt, tags

What I tried

Considered: pagination, field filtering, summary-only mode