Skip to main content
Glama

search_cards

Read-only

Search Yu-Gi-Oh! cards by keywords, including card names and effect descriptions, using this tool on the ygocdb-mcp server to quickly find relevant cards.

Instructions

通过关键字搜索游戏王卡牌,可以搜索卡牌名称、效果文本等。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes搜索关键字,可以是卡牌名称、效果描述等

Implementation Reference

  • The handler function for the 'search_cards' tool. It constructs the YGOCDB search API URL using the provided query and optional config, fetches the response, and processes it via handleYgocdbResponse.
    async function handleSearchCards(query: string, config?: z.infer<typeof configSchema>) {
      const url = `${config?.apiUrl || BASE_URL}/?search=${encodeURIComponent(query)}`;
      const response = await fetch(url);
      return handleYgocdbResponse(response);
    }
  • Schema definition for the 'search_cards' tool, including name, description, input schema requiring a 'query' string, and annotations.
    const SEARCH_CARDS_TOOL: Tool = {
      name: "search_cards",
      description:
        "通过关键字搜索游戏王卡牌,可以搜索卡牌名称、效果文本等。",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "搜索关键字,可以是卡牌名称、效果描述等"
          }
        },
        required: ["query"]
      },
      annotations: {
        title: "通过关键字搜索游戏王卡牌",
        readOnlyHint: true,
        openWorldHint: true
      }
    };
  • index.ts:136-140 (registration)
    Registration of the 'search_cards' tool in the YGOCDB_TOOLS array, which is returned by the ListToolsRequestHandler.
    const YGOCDB_TOOLS = [
      SEARCH_CARDS_TOOL,
      GET_CARD_BY_ID_TOOL,
      GET_CARD_IMAGE_TOOL
    ] as const;
  • index.ts:276-278 (registration)
    MCP server registration of the tools list handler, which exposes the 'search_cards' tool via ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: YGOCDB_TOOLS
    }));
  • index.ts:285-288 (registration)
    Dispatch case in the CallToolRequestHandler switch statement that routes 'search_cards' calls to the handleSearchCards function.
    case "search_cards": {
      const { query } = args as { query: string };
      return await handleSearchCards(query, config);
    }
Behavior3/5

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

Annotations already provide readOnlyHint=true (safe read operation) and openWorldHint=true (open-ended querying), so the description doesn't need to repeat these. It adds some context by specifying searchable fields (name, effect text), but doesn't disclose behavioral traits like result limits, sorting, pagination, or error handling. With annotations covering safety and scope, this is adequate but not rich in additional behavioral details.

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 in Chinese that directly states the tool's function without redundancy. It's front-loaded with the core action ('通过关键字搜索游戏王卡牌') and adds necessary detail ('可以搜索卡牌名称、效果文本等'). There's zero waste, making it highly concise and well-structured for quick understanding.

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

Completeness3/5

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

Given the tool's low complexity (single parameter, no output schema), annotations provide safety and scope hints, and the description covers the basic purpose, this is minimally viable. However, it lacks details on output format (e.g., what data is returned), error cases, or integration with siblings, leaving gaps that could hinder effective use by an AI agent in more complex scenarios.

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 input schema has 100% description coverage, with the 'query' parameter documented as supporting card names and effect descriptions. The description adds minimal value by restating this in Chinese ('可以搜索卡牌名称、效果文本等'), but doesn't provide extra semantics like query syntax examples, character limits, or language support. Baseline 3 is appropriate since the schema does the heavy lifting.

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 tool's purpose: searching Yu-Gi-Oh cards by keyword across name and effect text. It uses specific verbs ('搜索' - search) and resources ('游戏王卡牌' - Yu-Gi-Oh cards). However, it doesn't explicitly distinguish from sibling tools like get_card_by_id (which retrieves by ID) or get_card_image (which fetches images), leaving some ambiguity about when to choose this over alternatives.

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. It mentions what can be searched (name, effect text) but doesn't specify scenarios where this is preferred over get_card_by_id (e.g., for exact ID-based lookup) or get_card_image (e.g., for visual content). There's no mention of prerequisites, limitations, or exclusions, leaving usage context implied at best.

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

Related 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/lieyanqzu/ygocdb-mcp'

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