Skip to content
v8.0

Compound Operations

Single-call tools that combine multiple queries into one optimized operation. Reduce AI overhead by 60-70%.

Key Benefits

60-70% reduction in AI tool calls
Lower token overhead for AI assistants
Faster response times with fewer round-trips
Smart aggregation with disambiguation handling
Consistent output format across operations
Built-in error handling for partial failures

Before vs After

Without Compound Ops

To understand a symbol, AI makes 5 sequential calls:

  1. 1. searchSymbols → find the symbol
  2. 2. getSymbol → get metadata
  3. 3. explainSymbol → get explanation
  4. 4. findReferences → get usages
  5. 5. getCallGraph → get callers/callees
5 tool calls

With Compound Ops

Same information in a single call:

understand { "query": "HandleRequest" }

Returns: symbol, explanation, references, callers, callees, and related tests

1 tool call

Example: explore

// Request
{
  "name": "explore",
  "arguments": {
    "target": "internal/api",
    "depth": "standard",
    "focus": "structure"
  }
}

// Response includes:
{
  "overview": { "files": 12, "symbols": 145, "lines": 2340 },
  "keySymbols": [
    { "name": "HandleRequest", "kind": "function", "importance": "high" },
    { "name": "Router", "kind": "struct", "importance": "high" }
  ],
  "dependencies": { "internal": 5, "external": 3 },
  "hotspots": [{ "file": "handler.go", "churn": 23, "risk": "medium" }],
  "suggestions": ["Explore HandleRequest for request flow"]
}

All Compound Operations

explore

Area exploration: symbols, dependencies, hotspots in one call

Replaces: explainFile → searchSymbols → getCallGraph → getHotspots
{ "target": "internal/api", "depth": "standard", "focus": "structure" }
understand

Symbol deep-dive with refs, callers, explanation

Replaces: searchSymbols → getSymbol → explainSymbol → findReferences → getCallGraph
{ "query": "HandleRequest", "includeReferences": true }
prepareChange

Pre-change analysis with impact, tests, and risk

Replaces: analyzeImpact + getAffectedTests + analyzeCoupling + risk calculation
{ "target": "ckb:repo:sym:abc123", "changeType": "modify" }
batchGet

Fetch up to 50 symbols in a single call

Replaces: 50 individual getSymbol calls
{ "symbolIds": ["ckb:repo:sym:abc", "ckb:repo:sym:def", ...] }
batchSearch

Run up to 10 searches in one call

Replaces: 10 individual searchSymbols calls
{ "queries": [{ "query": "Handler" }, { "query": "Service" }] }

Fewer calls. Same power.

Compound operations are available in all MCP presets.