Skip to main content
Glama

get_pokemon_cry

Retrieve Pokémon cry audio file URLs by providing the Pokémon name or ID number. Use this tool to access authentic Pokémon sounds for applications or analysis.

Instructions

ポケモンの鳴き声音声ファイルのURLを取得

Input Schema

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

Implementation Reference

  • The handler function that implements the get_pokemon_cry tool. It fetches Pokemon data from PokeAPI, constructs the cry URL using the Pokemon's ID, verifies the URL exists, and returns the cry information as JSON.
    private async getPokemonCry(pokemon: string) { try { const data = await this.fetchPokemonData(pokemon); // 鳴き声ファイルのURL(PokeAPI/cries リポジトリから) const cryUrl = `https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/${data.id}.ogg`; // URLが有効かチェック const response = await axios.head(cryUrl); if (response.status !== 200) { throw new Error(`鳴き声ファイルが見つかりません: ${cryUrl}`); } const cryInfo = { name: data.name, id: data.id, cry_url: cryUrl, format: "ogg", source: "PokeAPI/cries repository" }; return { content: [ { type: "text", text: JSON.stringify(cryInfo, null, 2) } ] }; } catch (error) { return { content: [ { type: "text", text: `エラー: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
  • The input schema for the get_pokemon_cry tool, specifying a required 'pokemon' string parameter.
    inputSchema: { type: "object", properties: { pokemon: { type: "string", description: "ポケモン名またはID番号", }, }, required: ["pokemon"], },
  • src/index.ts:125-138 (registration)
    Tool registration in the ListTools response, defining name, description, and input schema.
    { name: "get_pokemon_cry", description: "ポケモンの鳴き声音声ファイルのURLを取得", inputSchema: { type: "object", properties: { pokemon: { type: "string", description: "ポケモン名またはID番号", }, }, required: ["pokemon"], }, },
  • src/index.ts:171-172 (registration)
    Dispatch logic in the CallToolRequest handler that routes calls to the getPokemonCry method.
    } else if (name === "get_pokemon_cry") { return await this.getPokemonCry(args.pokemon as string);

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