Skip to main content
Glama

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
NameRequiredDescriptionDefault
tileIdYesID of the tile to explore from
depthNoHow many levels deep to explore (default: 10)

Implementation Reference

  • 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);
    }
  • 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;
    }
  • 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,
    }));

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/k-chrispens/tiling-trees-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server