Skip to main content
Glama

search_names

Search Pokémon and moves using substring queries to find specific creatures or attacks in the Pokémon database.

Instructions

Búsqueda en PokeAPI de Pokémon y movimientos (substring).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • src/index.ts:50-55 (registration)
    Registers the 'search_names' MCP tool with input schema (query: string) and a handler that normalizes the query and calls pokeapi.searchNames, returning JSON content.
    registerTool('search_names', 'Búsqueda en PokeAPI de Pokémon y movimientos (substring).', { type:'object', properties:{ query:{ type:'string' } }, required:['query'] }, async (args:any) => { const q = String(args.query || ''); return jsonContent(await pokeapi.searchNames(q)); });
  • Input schema for search_names tool: requires a 'query' string parameter.
    type:'object', properties:{ query:{ type:'string' } }, required:['query']
  • Core handler logic: normalizes query, fetches all pokemon and move names via cached lists, filters substrings matches, uniques, limits to 50 per category, returns {pokemon: [...], moves: [...]}
    async searchNames(query: string) { const q = normName(query); const poke = await this.listNames('pokemon'); const moves = await this.listNames('move'); const filt = (arr:string[]) => unique(arr.filter(n => n.includes(q))).slice(0, 50); return { pokemon: filt(poke), moves: filt(moves) }; }
  • Helper function used by search_names handler (and others) to format response as MCP content with JSON text.
    const jsonContent = (obj:any)=>({ content: [{ type: 'text', text: JSON.stringify(obj, null, 2) }] });

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