Skip to main content
Glama

get_item_recipe

Find TFT item recipes to see which components build an item or what a component creates. Use for item planning and carousel decisions.

Instructions

Get the recipe for a TFT item (which components build it) or see what a component builds into. Use this for item planning and carousel decisions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesItem name to look up (e.g. "Infinity Edge", "B.F. Sword")

Implementation Reference

  • The main handler function that queries the SQLite database for item information, processes recipes, and returns either the component details or build information.
    export function getItemRecipe(
      db: Database.Database,
      input: GetItemRecipeInputType,
    ): GetItemRecipeResult | GetItemRecipeError {
      const item = findItemByName(db, input.name);
    
      if (!item) {
        const suggestions = getSuggestions(db, input.name);
        return {
          error: `Item "${input.name}" not found.`,
          suggestions,
        };
      }
    
      const detail = rowToDetail(item);
    
      // Completed item (has composition) — show its component recipe
      if (item.composition && item.isComponent === 0) {
        let componentApiNames: string[] = [];
        try {
          componentApiNames = JSON.parse(item.composition) as string[];
        } catch {
          // empty
        }
    
        const components: ItemDetail[] = [];
        for (const apiName of componentApiNames) {
          const compRow = db
            .prepare('SELECT * FROM items WHERE apiName = ?')
            .get(apiName) as ItemRow | undefined;
          if (compRow) {
            components.push(rowToDetail(compRow));
          }
        }
    
        return {
          result: {
            item: detail,
            components,
          },
        };
      }
    
      // Component item — show all completed items that use this component (reverse lookup)
      const completedRows = db
        .prepare(
          "SELECT * FROM items WHERE isComponent = 0 AND composition LIKE '%' || ? || '%'",
        )
        .all(item.apiName) as ItemRow[];
    
      const buildsInto: Array<{ item: ItemDetail; otherComponent: ItemDetail }> = [];
      for (const completedRow of completedRows) {
        let compApiNames: string[] = [];
        try {
          compApiNames = JSON.parse(completedRow.composition ?? '[]') as string[];
        } catch {
          // empty
        }
    
        // Find the other component (the one that isn't this item)
        const otherApiName = compApiNames.find((a) => a !== item.apiName) ?? compApiNames[0];
        let otherComponent: ItemDetail | null = null;
        if (otherApiName) {
          const otherRow = db
            .prepare('SELECT * FROM items WHERE apiName = ?')
            .get(otherApiName) as ItemRow | undefined;
          if (otherRow) {
            otherComponent = rowToDetail(otherRow);
          }
        }
    
        if (otherComponent) {
          buildsInto.push({
            item: rowToDetail(completedRow),
            otherComponent,
          });
        } else {
          buildsInto.push({
            item: rowToDetail(completedRow),
            otherComponent: detail, // self-combine (e.g. two of same component)
          });
        }
      }
    
      return {
        result: {
          item: detail,
          buildsInto,
        },
      };
    }
  • Zod schema for the 'get_item_recipe' tool input, requiring a name string.
    export const GetItemRecipeInput = z.object({
      name: z.string().describe('Item name to look up (e.g. "Infinity Edge", "B.F. Sword")'),
    });
  • src/server.ts:147-156 (registration)
    The tool 'get_item_recipe' is registered and invoked here, connecting the input validation to the handler and formatting the output.
    // 6. get_item_recipe
    server.tool(
      'get_item_recipe',
      'Get the recipe for a TFT item (which components build it) or see what a component builds into. Use this for item planning and carousel decisions.',
      GetItemRecipeInput.shape,
      async (params) => {
        try {
          const result = getItemRecipe(db, params);
          return {
            content: [{ type: 'text' as const, text: formatGetItemRecipe(result) }],
Behavior3/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. It implies a read-only lookup operation ('Get'), which is straightforward, but doesn't disclose behavioral traits like error handling (e.g., if the item name is invalid), performance aspects, or any rate limits. The description adds some context about use cases but lacks detailed behavioral transparency.

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 concise and well-structured in two sentences: the first states the purpose, and the second provides usage guidelines. Every sentence adds value without redundancy, making it front-loaded and efficient.

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

Completeness3/5

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

Given the tool's low complexity (single parameter, no output schema, no annotations), the description is somewhat complete but could be improved. It covers purpose and usage but lacks details on return values (since no output schema) and behavioral aspects like error cases. For a simple lookup tool, it's adequate but has gaps in fully informing the agent.

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 input schema has 100% description coverage, with the 'name' parameter documented as 'Item name to look up (e.g., "Infinity Edge", "B.F. Sword")'. The description adds no additional parameter semantics beyond this, as it doesn't explain format constraints or provide examples not in the schema. With high schema coverage, the baseline score of 3 is appropriate.

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 tool's purpose: 'Get the recipe for a TFT item (which components build it) or see what a component builds into.' It specifies the verb ('Get') and resource ('recipe for a TFT item'), but doesn't explicitly differentiate from sibling tools like 'search_items', which might handle broader item searches.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: 'Use this for item planning and carousel decisions.' This gives practical guidance on its application in TFT gameplay. However, it doesn't explicitly state when not to use it or name alternatives among siblings, such as distinguishing from 'search_items' for general item lookups.

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/gregario/tft-oracle'

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