explore_path
Visualize hierarchical tree structures from a specific tile to understand research idea relationships and organizational breakdowns.
Instructions
Explore the tree structure from a specific tile, showing the hierarchical breakdown
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tileId | Yes | ID of the tile to explore from | |
| depth | No | How many levels deep to explore (default: 10) |
Implementation Reference
- src/research-tree.ts:318-325 (handler)The core handler function for the 'explore_path' tool. It fetches the starting tile and recursively builds the hierarchical tree structure up to the specified depth using the private buildTileTree helper.explorePath(tileId: string, depth: number = 10): any { const tile = this.tiles.get(tileId); if (!tile) { throw new Error(`Tile ${tileId} not found`); } return this.buildTileTree(tile, depth); }
- src/research-tree.ts:327-343 (helper)Private recursive helper function that constructs the tree representation from a tile, including children up to the specified depth.private buildTileTree(tile: Tile, depth: number): any { const tree: any = { ...tile, children: [], }; if (depth > 0 && tile.childrenIds.length > 0) { tree.children = tile.childrenIds .map((childId) => { const child = this.tiles.get(childId); return child ? this.buildTileTree(child, depth - 1) : null; }) .filter((child) => child !== null); } return tree; }
- src/index.ts:236-253 (schema)JSON schema definition for the 'explore_path' tool, specifying input parameters tileId (required) and optional depth.{ name: "explore_path", description: "Explore the tree structure from a specific tile, showing the hierarchical breakdown", inputSchema: { type: "object", properties: { tileId: { type: "string", description: "ID of the tile to explore from", }, depth: { type: "number", description: "How many levels deep to explore (default: 10)", }, }, required: ["tileId"], }, },
- src/index.ts:531-544 (registration)Dispatch handler in the MCP server's CallToolRequestSchema switch statement that routes 'explore_path' calls to treeManager.explorePath and formats the response.case "explore_path": { const result = treeManager.explorePath( args.tileId as string, args.depth as number | undefined ); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:393-395 (registration)Registration of the tools list handler that includes 'explore_path' in the TOOLS array for MCP tool discovery.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));