Skip to main content
Glama
hollanddd

Pokédex MCP Server

by hollanddd

get_type_effectiveness

Retrieve type effectiveness data for Pokémon battles, including strengths, weaknesses, and resistances, to inform strategic decisions.

Instructions

Get type effectiveness information including strengths, weaknesses, and resistances

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name or ID of the type

Implementation Reference

  • src/tools.ts:32-48 (registration)
    Registers the 'get_type_effectiveness' MCP tool with server.tool(), including description, input schema using zod, and inline handler function.
    server.tool(
      "get_type_effectiveness",
      "Get type effectiveness information including strengths, weaknesses, and resistances",
      {
        name: z.string().min(1).describe("The name or ID of the type"),
      },
      async ({ name }) => {
        try {
          const effectiveness = await pokeAPI.getTypeEffectiveness(
            name.toLowerCase().trim(),
          );
          return formatTypeEffectiveness(effectiveness);
        } catch (error) {
          return formatCaughtError(error, "fetching type information");
        }
      },
    );
  • The tool handler function that executes the core logic: normalizes type name, fetches effectiveness data from pokeAPI, formats the response, and handles errors.
    async ({ name }) => {
      try {
        const effectiveness = await pokeAPI.getTypeEffectiveness(
          name.toLowerCase().trim(),
        );
        return formatTypeEffectiveness(effectiveness);
      } catch (error) {
        return formatCaughtError(error, "fetching type information");
      }
    },
  • Input schema definition using Zod for the tool parameter 'name'.
    {
      name: z.string().min(1).describe("The name or ID of the type"),
    },
  • PokeAPI client method that fetches type data and computes effectiveness multipliers (strong, weak, immune, etc.) from damage_relations.
    async getTypeEffectiveness(typeName: string): Promise<{
      type: Type;
      strongAgainst: string[];
      weakAgainst: string[];
      immuneTo: string[];
      resistantTo: string[];
      vulnerableTo: string[];
    }> {
      const type = await this.getType(typeName);
      
      return {
        type,
        strongAgainst: type.damage_relations.double_damage_to.map(t => t.name),
        weakAgainst: type.damage_relations.half_damage_to.map(t => t.name),
        immuneTo: type.damage_relations.no_damage_to.map(t => t.name),
        resistantTo: type.damage_relations.half_damage_from.map(t => t.name),
        vulnerableTo: type.damage_relations.double_damage_from.map(t => t.name),
      };
    }
  • Helper function to format the type effectiveness data into a user-friendly MCP text response with categorized lists.
    export function formatTypeEffectiveness(effectiveness: {
      type: Type;
      strongAgainst: string[];
      weakAgainst: string[];
      immuneTo: string[];
      resistantTo: string[];
      vulnerableTo: string[];
    }): MCPResponse {
      const formatList = (list: string[]) =>
        list.length > 0 ? list.join(", ") : "None";
    
      const pokemonList = effectiveness.type.pokemon
        .slice(0, 10)
        .map((p) => p.pokemon.name)
        .join(", ");
      
      const moreCount = effectiveness.type.pokemon.length > 10 
        ? ` and ${effectiveness.type.pokemon.length - 10} more...` 
        : "";
    
      return {
        content: [
          {
            type: "text",
            text: `**${effectiveness.type.name.toUpperCase()} Type Effectiveness**
    
    **Strong Against (2x damage to):** ${formatList(effectiveness.strongAgainst)}
    **Weak Against (0.5x damage to):** ${formatList(effectiveness.weakAgainst)}
    **No Effect Against (0x damage to):** ${formatList(effectiveness.immuneTo)}
    
    **Resistant To (0.5x damage from):** ${formatList(effectiveness.resistantTo)}
    **Vulnerable To (2x damage from):** ${formatList(effectiveness.vulnerableTo)}
    
    **Pokémon with this type:** ${pokemonList}${moreCount}`,
          },
        ],
      };
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 states the tool retrieves information, implying a read-only operation, but doesn't specify any behavioral traits such as error handling, rate limits, authentication needs, or what happens with invalid inputs. This leaves significant gaps for a tool with no annotation coverage.

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 directly states the tool's purpose without unnecessary details. It's front-loaded with the core action and resource, making it easy to understand at a glance, with no wasted words.

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 complexity of retrieving type effectiveness data, the description is incomplete. With no annotations, no output schema, and only basic parameter coverage, it lacks details on return values (e.g., format of strengths/weaknesses), error cases, or usage context. This makes it inadequate for an agent to fully understand how to use the tool 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 'The name or ID of the type'. The description adds no 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 also doesn't detract.

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 ('type effectiveness information'), specifying what information is retrieved (strengths, weaknesses, resistances). However, it doesn't explicitly differentiate from sibling tools like 'fetch_pokemon' or 'search_pokemon', which might also involve type data but focus on different resources.

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 any context, prerequisites, or exclusions, nor does it relate to sibling tools like 'fetch_pokemon' that might overlap in domain but serve different purposes (e.g., retrieving Pokémon vs. type effectiveness).

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/hollanddd/pokedex-mcp'

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