Skip to main content
Glama

get_learnset

Retrieve Pokémon move learnsets by version group and learning method to build optimal movesets for battles and team planning.

Instructions

Learnset por version_group y método.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoall
nameYes
version_groupNoemerald

Implementation Reference

  • The handler function for the 'get_learnset' tool. It processes input arguments, fetches learnset data using pokeapi.learnset, filters moves by method, and returns formatted JSON.
    }, async (args:any) => { const name = String(args.name), vg = String(args.version_group || 'emerald'), method = String(args.method || 'all'); const data = await pokeapi.learnset(name, vg); const filtered = data.filter(e => method==='all' || e.methods.some(m => m.method===method)); return jsonContent({ name, version_group: vg, method, moves: filtered }); });
  • JSON Schema defining the input parameters for the 'get_learnset' tool: pokemon name (required), optional version_group and method.
    type:'object', properties:{ name:{type:'string'}, version_group:{type:'string', default:'emerald'}, method:{type:'string', default:'all'} }, required:['name']
  • src/index.ts:65-74 (registration)
    Registration of the 'get_learnset' tool using registerTool, including schema and inline handler.
    registerTool('get_learnset', 'Learnset por version_group y método.', { type:'object', properties:{ name:{type:'string'}, version_group:{type:'string', default:'emerald'}, method:{type:'string', default:'all'} }, required:['name'] }, async (args:any) => { const name = String(args.name), vg = String(args.version_group || 'emerald'), method = String(args.method || 'all'); const data = await pokeapi.learnset(name, vg); const filtered = data.filter(e => method==='all' || e.methods.some(m => m.method===method)); return jsonContent({ name, version_group: vg, method, moves: filtered }); });
  • Core helper function pokeapi.learnset that retrieves and processes the pokemon's move learnset from PokeAPI, filtering by version_group and aggregating methods with levels.
    async learnset(name: string, version_group?: string) { const p = await this.getPokemon(name); const vg = this.validVersionGroup(version_group); const rows = p.moves as AnyObj[]; const out: { move: string, methods: {version_group:string, method:string, level:number}[] }[] = []; for (const r of rows) { const methods = (r.version_group_details as AnyObj[]) .filter(d => !vg || d.version_group.name === vg) .map(d => ({ version_group: d.version_group.name, method: this.methodAlias(d.move_learn_method.name), level: d.level_learned_at })); if (methods.length) out.push({ move: r.move.name, methods }); } return out; }

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