Skip to main content
Glama
hollanddd

Pokédex MCP Server

by hollanddd

search_pokemon

Find Pokémon by entering a partial name to retrieve detailed information from the Pokédex database.

Instructions

Search for Pokémon by partial name match

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesPartial name to search for

Implementation Reference

  • The handler function that implements the core logic of the search_pokemon tool: fetches a large list of Pokémon, filters by partial name match on the query, limits to top 20 results, and returns formatted search results or handles errors.
    async ({ query }) => {
      try {
        // Get a larger list to search through
        const pokemonList = await pokeAPI.getPokemonList(1500);
        const matches = pokemonList.results
          .filter((p) =>
            p.name.toLowerCase().includes(query.toLowerCase().trim()),
          )
          .slice(0, 20); // Limit to 20 results
    
        return formatPokemonSearchResults(query, matches);
      } catch (error) {
        return formatCaughtError(error, "searching Pokémon");
      }
    },
  • Input schema using Zod validation for the 'query' parameter, requiring a non-empty string.
    { query: z.string().min(1).describe("Partial name to search for") },
  • src/tools.ts:68-87 (registration)
    Registration of the search_pokemon tool with the MCP server, including name, description, schema, and handler.
    server.tool(
      "search_pokemon",
      "Search for Pokémon by partial name match",
      { query: z.string().min(1).describe("Partial name to search for") },
      async ({ query }) => {
        try {
          // Get a larger list to search through
          const pokemonList = await pokeAPI.getPokemonList(1500);
          const matches = pokemonList.results
            .filter((p) =>
              p.name.toLowerCase().includes(query.toLowerCase().trim()),
            )
            .slice(0, 20); // Limit to 20 results
    
          return formatPokemonSearchResults(query, matches);
        } catch (error) {
          return formatCaughtError(error, "searching Pokémon");
        }
      },
    );
  • Helper function that formats the search results (query and matching Pokémon list) into a user-friendly MCP text response, including numbered list with IDs and usage instructions.
    export function formatPokemonSearchResults(
      query: string,
      matches: Array<{ name: string; url: string }>
    ): MCPResponse {
      if (matches.length === 0) {
        return {
          content: [
            {
              type: "text",
              text: `No Pokémon found matching "${query}". Try a different search term.`,
            },
          ],
        };
      }
    
      const resultText = matches
        .map((p, index) => {
          const id = p.url.split("/").filter(Boolean).pop();
          return `${index + 1}. ${p.name} (ID: ${id})`;
        })
        .join("\n");
    
      return {
        content: [
          {
            type: "text",
            text: `**Search results for "${query}":**\n\n${resultText}\n\n*Use fetch_pokemon with any of these names to get detailed information.*`,
          },
        ],
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'partial name match', which hints at search behavior, but doesn't disclose other traits like pagination, rate limits, authentication needs, error handling, or what the return format looks like (especially with no output schema). For a search tool with zero annotation coverage, this is a significant gap in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It is appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration. Every word earns its place, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a search operation with one parameter), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the search returns (e.g., list of Pokémon objects, error cases), behavioral traits, or usage context. For a tool with minimal structured data, the description should provide more completeness to aid the agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the parameter 'query' documented as 'Partial name to search for'. The description adds no additional meaning beyond this, as it essentially restates the schema's description. With high schema coverage, the baseline is 3, and the description doesn't compensate with extra details like examples or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Search' and resource 'Pokémon', specifying 'by partial name match' which indicates the matching behavior. It distinguishes from siblings like 'fetch_pokemon' (likely by exact ID) and 'get_pokemon_encounters' (different resource), though it doesn't explicitly name alternatives. The purpose is specific but lacks explicit sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'fetch_pokemon' or 'get_pokemon_encounters'. It implies usage for partial name searches but doesn't state exclusions (e.g., when exact ID is known) or prerequisites. No explicit when/when-not instructions are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/hollanddd/pokedex-mcp'

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