Skip to main content
Glama

get_top_leaves

Retrieve highest-rated research idea tiles by sorting criteria like impact or feasibility to identify promising directions for investigation.

Instructions

Get the highest-rated leaf tiles based on evaluation criteria

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
criteriaYesCriteria to sort by
limitNoNumber of results to return (default: 10)
treeIdNoOptional tree ID to filter by

Implementation Reference

  • Core handler function getTopLeaves in ResearchTreeManager class that filters evaluated leaf tiles, computes scores based on specified criteria (impact, feasibility, uniqueness, or combined average), sorts descending, and returns top N results.
     * Get top-rated leaf tiles based on evaluation criteria
     */
    getTopLeaves(
      criteria: "impact" | "feasibility" | "uniqueness" | "combined",
      limit: number = 10,
      treeId?: string
    ): Tile[] {
      const leaves = this.getLeafTiles(treeId).filter((tile) => tile.evaluation);
    
      const scored = leaves.map((tile) => {
        let score = 0;
        const evaluation = tile.evaluation!;
    
        switch (criteria) {
          case "impact":
            score = evaluation.impact || 0;
            break;
          case "feasibility":
            score = evaluation.feasibility || 0;
            break;
          case "uniqueness":
            score = evaluation.uniqueness || 0;
            break;
          case "combined":
            score =
              ((evaluation.impact || 0) +
                (evaluation.feasibility || 0) +
                (evaluation.uniqueness || 0)) /
              3;
            break;
        }
    
        return { tile, score };
      });
    
      return scored
        .sort((a, b) => b.score - a.score)
        .slice(0, limit)
        .map((item) => item.tile);
    }
  • Input schema definition for the get_top_leaves tool, specifying required 'criteria' parameter and optional 'limit' and 'treeId'.
    {
      name: "get_top_leaves",
      description: "Get the highest-rated leaf tiles based on evaluation criteria",
      inputSchema: {
        type: "object",
        properties: {
          criteria: {
            type: "string",
            enum: ["impact", "feasibility", "uniqueness", "combined"],
            description: "Criteria to sort by",
          },
          limit: {
            type: "number",
            description: "Number of results to return (default: 10)",
          },
          treeId: {
            type: "string",
            description: "Optional tree ID to filter by",
          },
        },
        required: ["criteria"],
      },
    },
  • Dispatch handler in the main CallToolRequestSchema switch statement that invokes treeManager.getTopLeaves with parsed arguments and formats the JSON response.
    case "get_top_leaves": {
      const result = treeManager.getTopLeaves(
        args.criteria as any,
        args.limit as number | undefined,
        args.treeId as string | undefined
      );
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • src/index.ts:27-390 (registration)
    The get_top_leaves tool is included in the TOOLS array registered with server.setRequestHandler(ListToolsRequestSchema) to advertise available tools.
    const TOOLS: Tool[] = [
      {
        name: "create_tree",
        description: "Create a new tiling tree to explore a problem/challenge. The tree starts with a root tile representing the complete solution space, which you'll then split recursively using MECE (Mutually Exclusive, Collectively Exhaustive) principles.",
        inputSchema: {
          type: "object",
          properties: {
            name: {
              type: "string",
              description: "Name for this tiling tree",
            },
            problemStatement: {
              type: "string",
              description: "The problem or challenge to explore (e.g., 'How can we reduce carbon emissions in transportation?')",
            },
          },
          required: ["name", "problemStatement"],
        },
      },
      {
        name: "split_tile",
        description: "Split a tile into MECE (Mutually Exclusive, Collectively Exhaustive) subsets using a specific attribute/dimension. This is the core operation of the tiling trees method - partitioning the solution space systematically. Use physics/math-oriented splits when possible.",
        inputSchema: {
          type: "object",
          properties: {
            tileId: {
              type: "string",
              description: "ID of the tile to split",
            },
            splitAttribute: {
              type: "string",
              description: "The attribute/dimension used to split (e.g., 'energy source', 'scale', 'physical mechanism', 'timeframe')",
            },
            splitRationale: {
              type: "string",
              description: "Why this attribute was chosen for splitting",
            },
            subsets: {
              type: "array",
              items: {
                type: "object",
                properties: {
                  title: { type: "string" },
                  description: {
                    type: "string",
                    description: "Precise definition of this subset to ensure no overlap with siblings",
                  },
                  isLeaf: {
                    type: "boolean",
                    description: "True if this is a concrete idea/project (leaf node)",
                  },
                },
                required: ["title", "description"],
              },
              description: "The mutually exclusive and collectively exhaustive subsets",
            },
          },
          required: ["tileId", "splitAttribute", "splitRationale", "subsets"],
        },
      },
      {
        name: "add_tiles_to_split",
        description: "Add additional tiles to an existing split (when you realize a category was missed). This invalidates the MECE validation and requires re-verification.",
        inputSchema: {
          type: "object",
          properties: {
            parentId: {
              type: "string",
              description: "ID of the parent tile",
            },
            newTiles: {
              type: "array",
              items: {
                type: "object",
                properties: {
                  title: { type: "string" },
                  description: { type: "string" },
                  isLeaf: { type: "boolean" },
                },
                required: ["title", "description"],
              },
              description: "New tiles to add to the split",
            },
          },
          required: ["parentId", "newTiles"],
        },
      },
      {
        name: "mark_mece",
        description: "Mark a split as validated for MECE (Mutually Exclusive, Collectively Exhaustive) properties. Verify that the children completely cover the parent space with no overlaps.",
        inputSchema: {
          type: "object",
          properties: {
            tileId: {
              type: "string",
              description: "ID of the tile whose split to validate",
            },
            isMECE: {
              type: "boolean",
              description: "Whether the split is truly MECE",
            },
            coverageNotes: {
              type: "string",
              description: "Notes on the completeness and exclusivity of the split",
            },
          },
          required: ["tileId", "isMECE"],
        },
      },
      {
        name: "evaluate_tile",
        description: "Evaluate a leaf tile (concrete idea/project) on impact, feasibility, and uniqueness. Include any calculations or pilot studies performed.",
        inputSchema: {
          type: "object",
          properties: {
            tileId: {
              type: "string",
              description: "ID of the tile to evaluate",
            },
            impact: {
              type: "number",
              description: "Impact rating (1-10 scale)",
              minimum: 1,
              maximum: 10,
            },
            feasibility: {
              type: "number",
              description: "Feasibility rating (1-10 scale)",
              minimum: 1,
              maximum: 10,
            },
            uniqueness: {
              type: "number",
              description: "Uniqueness rating (1-10 scale)",
              minimum: 1,
              maximum: 10,
            },
            timeframe: {
              type: "string",
              description: "Expected timeframe (e.g., '1-2 years', '5-10 years')",
            },
            notes: {
              type: "string",
              description: "Additional evaluation notes",
            },
            calculationsOrPilots: {
              type: "string",
              description: "Calculations or pilot studies performed to evaluate this idea",
            },
          },
          required: ["tileId"],
        },
      },
      {
        name: "update_tile",
        description: "Update a tile's information (title, description, split attributes, etc.)",
        inputSchema: {
          type: "object",
          properties: {
            tileId: {
              type: "string",
              description: "ID of the tile to update",
            },
            title: {
              type: "string",
              description: "New title",
            },
            description: {
              type: "string",
              description: "New description (precise definition)",
            },
            splitAttribute: {
              type: "string",
              description: "Updated split attribute",
            },
            splitRationale: {
              type: "string",
              description: "Updated split rationale",
            },
            isLeaf: {
              type: "boolean",
              description: "Mark as leaf node",
            },
          },
          required: ["tileId"],
        },
      },
      {
        name: "get_trees",
        description: "Get all tiling trees",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        name: "get_tile",
        description: "Get details of a specific tile",
        inputSchema: {
          type: "object",
          properties: {
            tileId: {
              type: "string",
              description: "ID of the tile",
            },
          },
          required: ["tileId"],
        },
      },
      {
        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"],
        },
      },
      {
        name: "get_leaf_tiles",
        description: "Get all leaf tiles (concrete ideas/projects) from a tree",
        inputSchema: {
          type: "object",
          properties: {
            treeId: {
              type: "string",
              description: "Optional tree ID to filter by",
            },
          },
        },
      },
      {
        name: "get_unexplored_tiles",
        description: "Get tiles that haven't been split yet - these are gaps in your solution space exploration",
        inputSchema: {
          type: "object",
          properties: {
            treeId: {
              type: "string",
              description: "Optional tree ID to filter by",
            },
          },
        },
      },
      {
        name: "get_top_leaves",
        description: "Get the highest-rated leaf tiles based on evaluation criteria",
        inputSchema: {
          type: "object",
          properties: {
            criteria: {
              type: "string",
              enum: ["impact", "feasibility", "uniqueness", "combined"],
              description: "Criteria to sort by",
            },
            limit: {
              type: "number",
              description: "Number of results to return (default: 10)",
            },
            treeId: {
              type: "string",
              description: "Optional tree ID to filter by",
            },
          },
          required: ["criteria"],
        },
      },
      {
        name: "search_tiles",
        description: "Search for tiles by content",
        inputSchema: {
          type: "object",
          properties: {
            query: {
              type: "string",
              description: "Search query",
            },
            treeId: {
              type: "string",
              description: "Optional tree ID to filter by",
            },
          },
          required: ["query"],
        },
      },
      {
        name: "get_coverage_analysis",
        description: "Analyze the completeness of solution space exploration for a tree. Shows unexplored branches, unvalidated splits, and suggestions for next steps.",
        inputSchema: {
          type: "object",
          properties: {
            treeId: {
              type: "string",
              description: "ID of the tree to analyze",
            },
          },
          required: ["treeId"],
        },
      },
      {
        name: "get_statistics",
        description: "Get overall statistics about all tiling trees",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        name: "export_tree",
        description: "Export a tiling tree in various formats for visualization or documentation",
        inputSchema: {
          type: "object",
          properties: {
            treeId: {
              type: "string",
              description: "ID of the tree to export",
            },
            format: {
              type: "string",
              enum: ["json", "markdown", "mermaid", "dot"],
              description: "Export format",
            },
          },
          required: ["treeId", "format"],
        },
      },
      {
        name: "validate_split_quality",
        description: "Validate split quality and detect common antipatterns (vague language, catch-all buckets, mixed dimensions, retroactive splitting, incomplete coverage). Returns a detailed quality report with issues and recommendations.",
        inputSchema: {
          type: "object",
          properties: {
            tileId: {
              type: "string",
              description: "ID of the tile whose split to validate",
            },
          },
          required: ["tileId"],
        },
      },
      {
        name: "get_tree_validation_report",
        description: "Get validation report for all splits in a tree. Identifies antipatterns and provides an overall quality score. Use this after building a tree to check for common failure modes.",
        inputSchema: {
          type: "object",
          properties: {
            treeId: {
              type: "string",
              description: "ID of the tree to validate",
            },
          },
          required: ["treeId"],
        },
      },
    ];
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'highest-rated' and 'based on evaluation criteria', implying a ranking operation, but doesn't describe how ratings are determined, whether results are paginated, what the output format is, or any performance considerations like rate limits. For a tool with no annotations and unknown output, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Get the highest-rated leaf tiles') and adds necessary qualification ('based on evaluation criteria'). There is no wasted wording, repetition, or unnecessary elaboration, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (ranking operation with 3 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like how ratings are computed, output structure, or error handling. For a tool that likely returns a list of ranked items, more context is needed to guide the agent effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds minimal meaning beyond the input schema, which has 100% coverage. It implies parameters relate to sorting and limiting results, but doesn't explain the semantics of 'criteria' (e.g., what 'impact' or 'combined' mean) or how 'treeId' filtering works. With high schema coverage, the baseline is 3, as the schema documents parameters adequately without extra description value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('highest-rated leaf tiles'), specifying they are based on 'evaluation criteria'. It distinguishes from siblings like 'get_leaf_tiles' (which likely returns all leaves) by focusing on top-rated ones. However, it doesn't explicitly differentiate from 'get_statistics' or 'get_coverage_analysis', which might overlap in ranking aspects.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose it over 'get_leaf_tiles' (for unfiltered leaves), 'search_tiles' (for broader searches), or 'get_statistics' (for analytical data). There's no context on prerequisites, exclusions, or typical use cases, leaving the agent to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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