Skip to main content
Glama

get_evolutions

Retrieve the complete evolution chain for any Pokémon species, showing all evolutionary paths and relationships from the base form to final evolutions.

Instructions

Cadena/grafo de evoluciones desde species->evolution_chain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • src/index.ts:76-82 (registration)
    Registers the get_evolutions tool with description, input schema, and inline handler function that delegates to pokeapi helpers.
    registerTool('get_evolutions', 'Cadena/grafo de evoluciones desde species->evolution_chain.', { type:'object', properties:{ name:{type:'string'} }, required:['name'] }, async (args:any) => { const name = String(args.name); const chain = await pokeapi.getEvolutionChainBySpeciesName(name); return jsonContent({ name, edges: pokeapi.parseEvolutionChain(chain) }); });
  • The main handler function for the tool, which takes the pokemon name, fetches the evolution chain data, parses it into edges, and returns as JSON.
    }, async (args:any) => { const name = String(args.name); const chain = await pokeapi.getEvolutionChainBySpeciesName(name); return jsonContent({ name, edges: pokeapi.parseEvolutionChain(chain) }); });
  • Input schema requiring a 'name' string parameter.
    type:'object', properties:{ name:{type:'string'} }, required:['name']
  • Helper method that retrieves the full evolution chain by first getting the species and then fetching the chain URL.
    async getEvolutionChainBySpeciesName(name: string): Promise<AnyObj> { const sp = await this.getSpecies(name); const url = sp.evolution_chain.url as string; return this.getJSON(url); }
  • Helper function that recursively parses the evolution chain into a list of directed edges with evolution conditions.
    parseEvolutionChain(chain: AnyObj) { const edges: {from:string,to:string,conditions:AnyObj}[] = []; function walk(node: AnyObj) { const from = node.species.name; for (const evo of node.evolves_to as AnyObj[]) { const to = evo.species.name; const conds = (evo.evolution_details?.[0]) || {}; edges.push({ from, to, conditions: conds }); walk(evo); } } walk(chain.chain); return edges; }

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/EscasanN/MCP_Pokemon'

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