Skip to main content
Glama

team_analysis

Analyze Pokémon team defensive synergies using type effectiveness data from PokeAPI to identify strengths and weaknesses in team composition.

Instructions

Sinergias defensivas del equipo (usa tipos de PokeAPI y tabla de tipos).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
teamYes

Implementation Reference

  • Handler function for 'team_analysis' tool: fetches types for each Pokemon in the team, computes defensive weaknesses, resistances, and immunities against all Pokemon types using type matchups.
    }, async (args:any) => { const team = args.team as { name:string }[]; const roster = await Promise.all(team.map(async m => { const core = await pokeapi.pokemonCore(m.name); return { name: core.name, types: core.types }; })); const allTypes = ['normal','fire','water','electric','grass','ice','fighting','poison','ground','flying','psychic','bug','rock','ghost','dragon','dark','steel','fairy']; const totals: Record<string,{weak:number,resist:number,immune:number}> = Object.fromEntries(allTypes.map(t => [t,{weak:0,resist:0,immune:0}])) as any; for (const r of roster) { for (const atk of allTypes) { const mult = await pokeapi.typeMultiplier(atk, r.types); if (mult === 0) totals[atk].immune++; else if (mult > 1) totals[atk].weak++; else if (mult < 1) totals[atk].resist++; } } return jsonContent({ roster, totals }); });
  • Input schema for the 'team_analysis' tool, requiring a 'team' array of objects each with a 'name' property (Pokemon names).
    type:'object', properties:{ team:{ type:'array', items:{ type:'object', properties:{ name:{type:'string'} }, required:['name'] }, minItems:1, maxItems:6 } }, required:['team']
  • src/index.ts:197-218 (registration)
    Registration of the 'team_analysis' tool using registerTool, including inline schema and handler.
    registerTool('team_analysis', 'Sinergias defensivas del equipo (usa tipos de PokeAPI y tabla de tipos).', { type:'object', properties:{ team:{ type:'array', items:{ type:'object', properties:{ name:{type:'string'} }, required:['name'] }, minItems:1, maxItems:6 } }, required:['team'] }, async (args:any) => { const team = args.team as { name:string }[]; const roster = await Promise.all(team.map(async m => { const core = await pokeapi.pokemonCore(m.name); return { name: core.name, types: core.types }; })); const allTypes = ['normal','fire','water','electric','grass','ice','fighting','poison','ground','flying','psychic','bug','rock','ghost','dragon','dark','steel','fairy']; const totals: Record<string,{weak:number,resist:number,immune:number}> = Object.fromEntries(allTypes.map(t => [t,{weak:0,resist:0,immune:0}])) as any; for (const r of roster) { for (const atk of allTypes) { const mult = await pokeapi.typeMultiplier(atk, r.types); if (mult === 0) totals[atk].immune++; else if (mult > 1) totals[atk].weak++; else if (mult < 1) totals[atk].resist++; } } return jsonContent({ roster, totals }); });

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