Skip to main content
MCP Tools

get_execution_path

Find the execution path between two symbols using Prize-Collecting Steiner Tree (PCST). Returns the minimum connected subgraph that links the source to the sink while respecting a token budget.

Input schema

{
"type": "object",
"required": ["source", "sink"],
"properties": {
"source": {
"type": "string",
"description": "Starting symbol or file path (e.g. 'src/routes/auth.ts#login')."
},
"sink": {
"type": "string",
"description": "Target symbol or file path (e.g. 'src/db/connection.ts#query')."
},
"token_budget": {
"type": "integer",
"default": 2000,
"minimum": 200,
"description": "Maximum tokens in the returned subgraph."
},
"repo": { "type": "string" }
}
}

Output schema

{
"type": "object",
"properties": {
"source": { "type": "string" },
"sink": { "type": "string" },
"path": {
"type": "array",
"items": {
"type": "object",
"properties": {
"symbol": { "type": "string" },
"path": { "type": "string" },
"line": { "type": "integer" },
"edge": { "type": "string", "description": "Edge kind connecting this node to the next." }
}
}
},
"tokens_used": { "type": "integer" },
"found": { "type": "boolean" }
}
}

Example

Request:

{
"source": "src/routes/auth.ts#login",
"sink": "src/auth/jwt.ts#sign",
"token_budget": 1500
}

Response:

{
"source": "src/routes/auth.ts#login",
"sink": "src/auth/jwt.ts#sign",
"found": true,
"tokens_used": 847,
"path": [
{ "symbol": "login", "path": "src/routes/auth.ts", "line": 24, "edge": "calls" },
{ "symbol": "AuthController.login", "path": "src/controllers/AuthController.ts", "line": 88, "edge": "calls" },
{ "symbol": "SessionService.create","path": "src/services/SessionService.ts", "line": 41, "edge": "calls" },
{ "symbol": "sign", "path": "src/auth/jwt.ts", "line": 12, "edge": null }
]
}

When to use

  • Security audit: trace the path from a public HTTP handler to a database write or crypto primitive.
  • Debugging: find why a change in module A unexpectedly affects module B by tracing the execution path.
  • Documentation: generate accurate call graphs for design docs.

Notes

  • Returns "found": false if no path exists within the graph (the source and sink are not connected).
  • PCST may return a path with intermediate "Steiner nodes" that are not direct call sites but bridge the connected components. These are marked with the edge field.