Skip to main content
Glama

get_trait

Retrieve detailed TFT trait information including breakpoint thresholds, scaling values, and associated champions to understand synergy requirements and team composition planning.

Instructions

Get full details for a TFT trait including breakpoint thresholds, scaling values, and all champions with this trait. Use this to understand synergy requirements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesTrait name to look up (exact or partial match)

Implementation Reference

  • The handler function 'getTrait' that implements the logic for searching traits in the database.
    export function getTrait(
      db: Database.Database,
      input: GetTraitInputType,
    ): GetTraitResult {
      // 1. Exact match (case-insensitive)
      const exact = db
        .prepare('SELECT * FROM traits WHERE LOWER(name) = LOWER(?)')
        .get(input.name) as TraitRow | undefined;
    
      if (exact) {
        return { found: true, trait: toTraitDetail(db, exact) };
      }
    
      // 2. LIKE partial match (case-insensitive)
      const likeRow = db
        .prepare('SELECT * FROM traits WHERE LOWER(name) LIKE LOWER(?)')
        .get(`%${input.name}%`) as TraitRow | undefined;
    
      if (likeRow) {
        return { found: true, trait: toTraitDetail(db, likeRow) };
      }
    
      // 3. FTS5 match
      try {
        const ftsRow = db
          .prepare(
            `SELECT t.*
             FROM traits_fts fts
             JOIN traits t ON t.rowid = fts.rowid
             WHERE traits_fts MATCH ?
             ORDER BY fts.rank
             LIMIT 1`,
          )
          .get(input.name) as TraitRow | undefined;
    
        if (ftsRow) {
          return { found: true, trait: toTraitDetail(db, ftsRow) };
        }
      } catch {
        // FTS5 can throw on invalid query syntax — fall through to not found
      }
    
      // 4. Not found — provide suggestions
      const firstWord = input.name.split(/\s+/)[0];
      const suggestions = db
        .prepare('SELECT name FROM traits WHERE LOWER(name) LIKE LOWER(?) LIMIT 5')
        .all(`%${firstWord}%`) as Array<{ name: string }>;
    
      const suggestionNames = suggestions.map((s) => s.name);
    
      return {
        found: false,
        message: `No trait found matching "${input.name}".`,
        suggestions: suggestionNames.length > 0 ? suggestionNames : undefined,
      };
    }
  • Zod schema for validating the input to the get_trait tool.
    export const GetTraitInput = z.object({
      name: z.string().describe('Trait name to look up (exact or partial match)'),
    });
  • src/server.ts:107-116 (registration)
    Registration and execution point for the 'get_trait' tool in the main server file.
    // 4. get_trait
    server.tool(
      'get_trait',
      'Get full details for a TFT trait including breakpoint thresholds, scaling values, and all champions with this trait. Use this to understand synergy requirements.',
      GetTraitInput.shape,
      async (params) => {
        try {
          const result = getTrait(db, params);
          return {
            content: [{ type: 'text' as const, text: formatGetTrait(result) }],
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions what details are returned but doesn't cover critical aspects like whether it's a read-only operation, potential errors (e.g., if trait not found), response format, or performance considerations. The description adds some context about the data returned but lacks comprehensive behavioral traits.

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 with two sentences: the first states the purpose and details, and the second provides usage guidance. 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 complexity (single parameter, no output schema, no annotations), the description is moderately complete. It covers the purpose and some usage context but lacks details on behavior, error handling, and output format. Without annotations or output schema, more information would be beneficial for an AI agent to use it 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 input schema has 100% description coverage, with the parameter 'name' documented as 'Trait name to look up (exact or partial match).' The description doesn't add any additional meaning beyond this, such as examples or constraints. Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't compensate but doesn't need to.

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 with a specific verb ('Get') and resource ('full details for a TFT trait'), including what details are returned (breakpoint thresholds, scaling values, champions). It distinguishes from siblings like 'search_traits' by focusing on detailed lookup rather than search. However, it doesn't explicitly differentiate from 'get_champion' or 'get_item_recipe' beyond the resource type.

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

Usage Guidelines3/5

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

The description provides implied usage guidance by stating 'Use this to understand synergy requirements,' which suggests when to use it. However, it lacks explicit guidance on when to choose this tool over alternatives like 'search_traits' (e.g., for exact vs. partial matching) or other siblings. No exclusions or prerequisites are mentioned.

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