describe_symbol
Retrieve comprehensive details about a function or class: signature, parameters, callers, callees, and related domain concepts – without reading its source file. Ideal for understanding what a symbol does and its role in the codebase.
Instructions
Describe a function or class WITHOUT reading its source file — returns signature, parameters, callers, callees, and related domain concepts. Faster and more informative than Read for understanding what a symbol does and how it fits into the codebase. Use when asked 'what does function X do' or 'what is class X'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Function or class name (e.g. 'spatial_transform') |
Implementation Reference
- pi/extensions/index.ts:232-245 (schema)Schema definition for the 'describe_symbol' tool — defines the 'name' parameter (function or class name) and sets the MCP name, label, description, and prompt snippet.
{ mcpName: "describe_symbol", label: "Describe Symbol", description: "Describe a function or class without reading its source — returns " + "signature, parameters, callers, callees, semantic role.", promptSnippet: "ontomics_describe_symbol: function/class info without reading source", parameters: Type.Object({ name: Type.String({ description: "Function or class name (e.g. 'spatial_transform')", }), }), }, - pi/extensions/index.ts:362-387 (registration)Registration loop iterates over all tool defs and calls pi.registerTool for each, including 'describe_symbol'. The execute method calls the remote MCP server's 'describe_symbol' tool via the McpClient wrapper.
for (const def of toolDefs()) { pi.registerTool({ name: `ontomics_${def.mcpName}`, label: def.label, description: def.description, promptSnippet: def.promptSnippet, promptGuidelines: [ "Use ontomics tools BEFORE grep/glob for semantic codebase questions.", ], parameters: def.parameters, async execute(_toolCallId, params, _signal, onUpdate, _ctx) { onUpdate?.({ content: [{ type: "text", text: `Querying ontomics: ${def.mcpName}...` }], }); try { const mcp = await getClient(); const text = await mcp.callTool(def.mcpName, cleanArgs(params)); return { content: [{ type: "text", text }] }; } catch (err) { throw new Error( `ontomics ${def.mcpName} failed: ${err instanceof Error ? err.message : String(err)}`, ); } }, }); } - pi/extensions/index.ts:372-385 (handler)The actual handler for 'describe_symbol' — an async execute function that forwards the call to the remote ontomics MCP server via McpClient.callTool('describe_symbol', params). Actual business logic lives in the external ontomics binary.
async execute(_toolCallId, params, _signal, onUpdate, _ctx) { onUpdate?.({ content: [{ type: "text", text: `Querying ontomics: ${def.mcpName}...` }], }); try { const mcp = await getClient(); const text = await mcp.callTool(def.mcpName, cleanArgs(params)); return { content: [{ type: "text", text }] }; } catch (err) { throw new Error( `ontomics ${def.mcpName} failed: ${err instanceof Error ? err.message : String(err)}`, ); } },