Skip to main content
Glama

get_pokemon_stats

Retrieve base Pokémon statistics including HP, attack, defense, special attack, special defense, and speed by providing a Pokémon name or ID number.

Instructions

ポケモンの基礎ステータス(HP、こうげき、ぼうぎょ、とくこう、とくぼう、すばやさ)を取得

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pokemonYesポケモン名またはID番号

Implementation Reference

  • The core handler function that fetches Pokemon data from the PokeAPI, extracts and formats the base stats (HP, attack, defense, special-attack, special-defense, speed), includes additional info like name, id, types, and base_experience, and returns it as MCP-formatted content or an error.
    private async getPokemonStats(pokemon: string) {
      try {
        const data = await this.fetchPokemonData(pokemon);
    
        // ステータス情報を初期化
        const stats: PokemonStats = {
          hp: 0,
          attack: 0,
          defense: 0,
          "special-attack": 0,
          "special-defense": 0,
          speed: 0
        };
    
        // APIから取得したステータスデータを整形
        data.stats.forEach(stat => {
          const statName = stat.stat.name as keyof PokemonStats;
          if (statName in stats) {
            stats[statName] = stat.base_stat;
          }
        });
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                name: data.name,
                id: data.id,
                stats: stats,
                types: data.types.map(t => t.type.name),
                base_experience: data.base_experience
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `エラー: ${error instanceof Error ? error.message : String(error)}`
            }
          ],
          isError: true
        };
      }
    }
  • src/index.ts:83-96 (registration)
    Tool registration in the listTools response, including name, description, and input schema.
    {
      name: "get_pokemon_stats",
      description: "ポケモンの基礎ステータス(HP、こうげき、ぼうぎょ、とくこう、とくぼう、すばやさ)を取得",
      inputSchema: {
        type: "object",
        properties: {
          pokemon: {
            type: "string",
            description: "ポケモン名またはID番号",
          },
        },
        required: ["pokemon"],
      },
    },
  • Input schema definition for the get_pokemon_stats tool, specifying the required 'pokemon' string parameter.
    inputSchema: {
      type: "object",
      properties: {
        pokemon: {
          type: "string",
          description: "ポケモン名またはID番号",
        },
      },
      required: ["pokemon"],
    },
  • TypeScript interface defining the structure of Pokemon stats used in the handler.
    interface PokemonStats {
      hp: number;                    // HP(ヒットポイント)
      attack: number;                // こうげき
      defense: number;               // ぼうぎょ
      "special-attack": number;      // とくこう
      "special-defense": number;     // とくぼう
      speed: number;                 // すばやさ
    }
  • Helper function to fetch raw Pokemon data from PokeAPI, used by the getPokemonStats handler.
    private async fetchPokemonData(pokemon: string): Promise<PokemonData> {
      try {
        const response = await axios.get(`https://pokeapi.co/api/v2/pokemon/${pokemon.toLowerCase()}`);
        return response.data;
      } catch (error) {
        if (axios.isAxiosError(error) && error.response?.status === 404) {
          throw new Error(`ポケモン "${pokemon}" が見つかりません`);
        }
        throw new Error(`ポケモンデータの取得に失敗しました: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
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 only states what the tool does (retrieve stats) without mentioning critical traits like whether it's read-only, requires authentication, has rate limits, or what happens on errors. For a tool with zero annotation coverage, this is a significant gap in 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 a single, efficient sentence that front-loads the core purpose and lists the specific stats retrieved. There is no wasted text, making it appropriately sized and well-structured for clarity.

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 (1 parameter, no output schema, no annotations), the description is minimally adequate. It explains what stats are retrieved but lacks context on behavioral traits, error handling, or output format. Without annotations or output schema, more detail would improve completeness for agent use.

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 'pokemon' documented as 'ポケモン名またはID番号' (Pokémon name or ID number). The description does not add any meaning beyond this, such as examples or constraints. 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: 'ポケモンの基礎ステータス(HP、こうげき、ぼうぎょ、とくこう、とくぼう、すばやさ)を取得' (Retrieve a Pokémon's base stats: HP, Attack, Defense, Special Attack, Special Defense, Speed). It specifies the verb ('取得' - retrieve) and resource ('ポケモンの基礎ステータス' - Pokémon base stats), but does not explicitly differentiate from sibling tools like get_pokemon_info, which might provide broader information.

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 does not mention sibling tools (e.g., get_pokemon_info for general info, get_pokemon_cry for sound) or specify contexts where this tool is preferred, leaving usage decisions to inference.

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/t-daiki96/poke_mcp'

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