Skip to main content
Glama

get_set_cards

Read-only

Retrieve all cards from a specific Magic: The Gathering set with pagination and sorting. Specify set code, page size, and sorting criteria to display results, including prioritization for Chinese cards.

Instructions

获取特定系列的所有卡牌,支持分页和排序。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderNo排序字段 (例如: collector_number, name, -mv)
pageNo页码 (默认 1)
page_sizeNo每页数量 (默认 20,最大 100)
priority_chineseNo是否优先显示中文卡牌 (默认 true)
set_codeYes系列代码,例如 'NEO'、'MOM'

Implementation Reference

  • The handler function that implements the logic for fetching cards from a specific set using the SBWSZ API, supporting pagination, sorting, and Chinese priority.
    async function handleGetSetCards(
      setCode: string,
      page?: number,
      pageSize?: number,
      order?: string,
      priorityChinese?: boolean,
      config?: z.infer<typeof configSchema>
    ) {
      // 构建基础 URL
      let url = `${config?.apiUrl || BASE_URL}/set/${encodeURIComponent(setCode.toUpperCase())}/cards`;
    
      // 添加查询参数
      const params = new URLSearchParams();
      if (page !== undefined) params.append('page', page.toString());
      if (pageSize !== undefined) params.append('page_size', pageSize.toString());
      if (order !== undefined) params.append('order', order);
      if (priorityChinese !== undefined) params.append('priority_chinese', priorityChinese.toString());
    
      // 如果有查询参数,添加到 URL
      const queryString = params.toString();
      if (queryString) {
        url += `?${queryString}`;
      }
    
      const response = await fetch(url);
      return handleSbwszResponse(response);
    }
  • The tool schema defining the name, description, input schema, and annotations for the get_set_cards tool.
    const GET_SET_CARDS_TOOL: Tool = {
      name: "get_set_cards",
      description: "获取特定系列的所有卡牌,支持分页和排序。",
      inputSchema: {
        type: "object",
        properties: {
          set_code: {
            type: "string",
            description: "系列代码,例如 'NEO'、'MOM'"
          },
          page: {
            type: "integer",
            description: "页码 (默认 1)"
          },
          page_size: {
            type: "integer",
            description: "每页数量 (默认 20,最大 100)"
          },
          order: {
            type: "string",
            description: "排序字段 (例如: collector_number, name, -mv)"
          },
          priority_chinese: {
            type: "boolean",
            description: "是否优先显示中文卡牌 (默认 true)"
          }
        },
        required: ["set_code"]
      },
      annotations: {
        title: "获取特定系列的所有卡牌",
        readOnlyHint: true,
        openWorldHint: true
      }
    };
  • index.ts:269-276 (registration)
    Registration of the get_set_cards tool in the SBWSZ_TOOLS array used for listing available tools.
    const SBWSZ_TOOLS = [
      GET_CARD_BY_SET_AND_NUMBER_TOOL,
      SEARCH_CARDS_TOOL,
      GET_SETS_TOOL,
      GET_SET_TOOL,
      GET_SET_CARDS_TOOL,
      HZLS_TOOL
    ] as const;
  • index.ts:518-527 (registration)
    The switch case in the CallToolRequestSchema handler that dispatches calls to the get_set_cards handler function.
    case "get_set_cards": {
      const { set_code, page, page_size, order, priority_chinese } = args as {
        set_code: string;
        page?: number;
        page_size?: number;
        order?: string;
        priority_chinese?: boolean;
      };
      return await handleGetSetCards(set_code, page, page_size, order, priority_chinese, config);
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, indicating a safe read operation with potentially incomplete data. The description adds behavioral context by mentioning pagination and sorting support ('支持分页和排序'), which are useful operational details not covered by annotations. However, it doesn't disclose other behavioral traits like rate limits, authentication needs, or what happens with invalid set codes.

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 front-loads the core purpose ('获取特定系列的所有卡牌') and adds key operational features ('支持分页和排序'). There is no wasted wording, and every part of the sentence contributes directly to understanding the tool's functionality.

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 moderate complexity (5 parameters, no output schema), the description covers the basic purpose and key features (pagination, sorting). However, with annotations providing safety hints but no output schema, the description doesn't explain return values or error behaviors. For a list operation with pagination, more context on response structure or limitations would be helpful.

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 all parameters well-documented in the schema (e.g., 'set_code' as series code, 'page' as page number). The description adds minimal value beyond the schema by implying the tool uses these parameters for pagination and sorting, but doesn't provide additional semantic context like examples of sorting fields beyond what's in the schema.

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: '获取特定系列的所有卡牌' (get all cards of a specific series). It specifies the verb (获取/get) and resource (卡牌/cards) with scope (特定系列/specific series). However, it doesn't explicitly differentiate from sibling tools like 'get_card_by_set_and_number' (which gets a specific card) or 'search_cards' (which searches across series).

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 by mentioning '特定系列' (specific series), suggesting this tool is for retrieving cards within a set rather than searching across sets. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'search_cards' or 'get_card_by_set_and_number', nor does it mention any exclusions or prerequisites.

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/sbwsz-mcp'

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