outgoing_calls
Analyze Svelte code to identify all functions and methods called by a specific symbol, enabling developers to trace dependencies and understand code flow within their projects.
Instructions
Find all functions/methods called by the specified symbol.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Absolute path to the file | |
| symbolName | Yes | Name of the symbol to find | |
| symbolKind | No | Kind of symbol |
Implementation Reference
- src/tools/hierarchy.ts:88-128 (handler)The handler function for 'outgoing_calls' which attempts to retrieve call hierarchy information from the LSP and formats the result.
async ({ filePath, symbolName, symbolKind }): Promise<ToolResult> => { try { const prep = await prepareSymbolRequest(lsp, filePath, symbolName, symbolKind); if ("error" in prep) return textResult(prep.error); // Try native call hierarchy try { const prepareResult = await lsp.request( "textDocument/prepareCallHierarchy", makePositionParams(prep.ctx) ); if (Array.isArray(prepareResult) && prepareResult.length > 0) { const result = await lsp.request( "callHierarchy/outgoingCalls", { item: prepareResult[0] } ); if (Array.isArray(result) && result.length > 0) { const lines: string[] = [ `Found ${result.length} call(s) from '${symbolName}':`, "", ]; for (const call of result) { if (call.to) { lines.push(formatHierarchyItem(call.to)); } } return textResult(lines.join("\n")); } } } catch { // call hierarchy not supported } return textResult( `No outgoing calls found from '${symbolName}'.` ); } catch (ex) { return textResult(formatError(ex)); } } ); - src/tools/hierarchy.ts:74-87 (registration)Tool registration for 'outgoing_calls' including input schema definition.
server.registerTool( "outgoing_calls", { title: "Outgoing Calls", description: "Find all functions/methods called by the specified symbol.", inputSchema: z.object({ filePath: z.string().describe("Absolute path to the file"), symbolName: z .string() .describe("Name of the symbol to find"), symbolKind: z.string().optional().describe("Kind of symbol"), }), },