Skip to main content
Glama

get_card_by_id

Read-only

Retrieve detailed information for a specific Yu-Gi-Oh! card using its unique ID. Input the card ID to access card details instantly via the ygocdb-mcp server.

Instructions

通过卡牌ID获取单张游戏王卡牌的详细信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes游戏王卡牌ID,通常为八位数字

Implementation Reference

  • The main handler function that fetches the card data from YGOCDB API using the provided ID as a search query and processes the response using the shared response handler.
    async function handleGetCardById(id: string, config?: z.infer<typeof configSchema>) {
      const url = `${config?.apiUrl || BASE_URL}/?search=${encodeURIComponent(id)}`;
      const response = await fetch(url);
      return handleYgocdbResponse(response);
    }
  • The Tool object defining the schema, including inputSchema for the 'id' parameter (string, required), description, and annotations.
    const GET_CARD_BY_ID_TOOL: Tool = {
      name: "get_card_by_id",
      description: "通过卡牌ID获取单张游戏王卡牌的详细信息",
      inputSchema: {
        type: "object",
        properties: {
          id: {
            type: "string",
            description: "游戏王卡牌ID,通常为八位数字"
          }
        },
        required: ["id"]
      },
      annotations: {
        title: "通过ID获取单张游戏王卡牌",
        readOnlyHint: true,
        openWorldHint: true
      }
    };
  • index.ts:136-140 (registration)
    The tool is registered in the YGOCDB_TOOLS array, which is returned by the listTools request handler.
    const YGOCDB_TOOLS = [
      SEARCH_CARDS_TOOL,
      GET_CARD_BY_ID_TOOL,
      GET_CARD_IMAGE_TOOL
    ] as const;
  • index.ts:289-292 (registration)
    The tool name is matched in the switch statement within the CallToolRequestSchema handler, dispatching to the handleGetCardById function.
    case "get_card_by_id": {
      const { id } = args as { id: string };
      return await handleGetCardById(id, config);
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true (safe read operation) and openWorldHint=true (may return unknown data). The description adds the specific scope of '单张游戏王卡牌' (single Yu-Gi-Oh! card), which provides useful context beyond annotations. However, it doesn't disclose additional behavioral traits like error handling, rate limits, or response format 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 that directly states the tool's purpose with zero wasted words. It's appropriately sized for a simple lookup tool and front-loaded with essential information.

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?

For a simple read operation with good annotations (readOnlyHint, openWorldHint) and full schema coverage, the description is minimally adequate. However, with no output schema, it doesn't explain what '详细信息' (detailed information) includes, leaving gaps about return values. The tool's low complexity keeps it from being incomplete, but it could be more comprehensive.

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?

Schema description coverage is 100%, with the parameter 'id' fully documented in the schema as '游戏王卡牌ID,通常为八位数字' (Yu-Gi-Oh! card ID, usually an eight-digit number). The description doesn't add any parameter semantics beyond what the schema already provides, so baseline 3 is appropriate.

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: '通过卡牌ID获取单张游戏王卡牌的详细信息' (Get detailed information of a single Yu-Gi-Oh! card by card ID). It specifies the verb '获取' (get) and resource '卡牌详细信息' (card details), but doesn't explicitly differentiate from sibling tools like 'search_cards' which likely searches by criteria rather than specific ID.

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

Usage Guidelines3/5

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

The description implies usage context (when you have a specific card ID), but doesn't explicitly state when to use this tool versus alternatives like 'search_cards' or 'get_card_image'. No guidance on prerequisites, exclusions, or comparative scenarios is provided.

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