Skip to main content
Glama

get_pokemon_info

Retrieve complete Pokémon information including stats, images, and basic data by name or ID number. Use this tool to access comprehensive Pokémon details from the PokeAPI database.

Instructions

ポケモンの完全な情報(ステータス、画像、基本情報)を取得

Input Schema

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

Implementation Reference

  • The core handler function for the 'get_pokemon_info' tool. Fetches Pokemon data from PokeAPI, processes base stats, extracts types, height, weight, experience, and various sprite images, then returns a JSON-formatted response.
    private async getPokemonInfo(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;
          }
        });
    
        // 全ての情報をまとめたオブジェクトを作成
        const pokemonInfo = {
          id: data.id,                                       // ポケモンID
          name: data.name,                                   // ポケモン名
          height: data.height,                               // 身長
          weight: data.weight,                               // 体重
          base_experience: data.base_experience,             // 基礎経験値
          types: data.types.map(t => t.type.name),          // タイプ配列
          stats: stats,                                      // ステータス情報
          images: {                                          // 画像情報
            front_default: data.sprites.front_default,      // 通常の前面画像
            front_shiny: data.sprites.front_shiny,          // 色違いの前面画像
            back_default: data.sprites.back_default,        // 通常の後面画像
            back_shiny: data.sprites.back_shiny,            // 色違いの後面画像
            official_artwork: data.sprites.other["official-artwork"].front_default  // 公式アートワーク
          }
        };
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(pokemonInfo, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `エラー: ${error instanceof Error ? error.message : String(error)}`
            }
          ],
          isError: true
        };
      }
    }
  • Input schema defining the required 'pokemon' parameter as a string for the tool.
    inputSchema: {
      type: "object",
      properties: {
        pokemon: {
          type: "string",
          description: "ポケモン名またはID番号",
        },
      },
      required: ["pokemon"],
    },
  • src/index.ts:111-124 (registration)
    Tool registration object in the array passed to server.setTools(), specifying name, description, and input schema.
    {
      name: "get_pokemon_info",
      description: "ポケモンの完全な情報(ステータス、画像、基本情報)を取得",
      inputSchema: {
        type: "object",
        properties: {
          pokemon: {
            type: "string",
            description: "ポケモン名またはID番号",
          },
        },
        required: ["pokemon"],
      },
    },
  • Shared helper function to fetch raw Pokemon data from PokeAPI endpoint, with specific handling for 404 not found errors.
    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?

With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions what information is retrieved (stats, images, basic info), it doesn't describe important behavioral aspects like whether this is a read-only operation, potential rate limits, authentication requirements, error conditions, or response format. The description is insufficient 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.

Conciseness4/5

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

The description is a single, efficient sentence that communicates the core purpose without unnecessary words. It's appropriately sized for a simple retrieval tool, though it could potentially be more structured by separating the different information types 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?

For a simple retrieval tool with 100% schema coverage but no annotations and no output schema, the description provides adequate basic information about what data is retrieved. However, it lacks details about the response format, error handling, and behavioral constraints that would be important for complete understanding, especially given the absence of annotations.

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?

Schema description coverage is 100% (the single parameter 'pokemon' is fully documented in the schema), so the baseline is 3. The description doesn't add any parameter-specific information beyond what's already in the schema, which states the parameter accepts either Pokémon name or ID number.

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/retrieve) and the resource ('ポケモンの完全な情報' - complete Pokémon information), including specific data types (stats, images, basic info). However, it doesn't explicitly differentiate from sibling tools like get_pokemon_stats or get_pokemon_images, which focus on subsets of this 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?

No guidance is provided about when to use this tool versus alternatives like get_pokemon_stats (for stats only) or get_pokemon_images (for images only). The description implies comprehensive data retrieval but doesn't explicitly state this as the distinguishing factor from sibling tools.

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