get_set
Fetch detailed information for a Magic: The Gathering card series using its set code. Ideal for accessing specific data from the sbwsz-mcp server for applications or workflows.
Instructions
根据系列代码获取单个系列的详细信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| set_code | Yes | 系列代码,例如 'NEO'、'MOM' |
Implementation Reference
- index.ts:364-368 (handler)The handler function that executes the 'get_set' tool logic: constructs the API URL using the set_code parameter and fetches the set details from the SBWSZ API.async function handleGetSet(setCode: string, config?: z.infer<typeof configSchema>) { const url = `${config?.apiUrl || BASE_URL}/set/${encodeURIComponent(setCode.toUpperCase())}`; const response = await fetch(url); return handleSbwszResponse(response); }
- index.ts:182-200 (schema)The Tool definition for 'get_set', including name, description, input schema (requiring 'set_code' string), and annotations.const GET_SET_TOOL: Tool = { name: "get_set", description: "根据系列代码获取单个系列的详细信息", inputSchema: { type: "object", properties: { set_code: { type: "string", description: "系列代码,例如 'NEO'、'MOM'" } }, required: ["set_code"] }, annotations: { title: "获取单个系列的详细信息", readOnlyHint: true, openWorldHint: true } };
- index.ts:514-517 (registration)Registers and dispatches 'get_set' tool calls in the MCP CallToolRequestSchema handler by extracting 'set_code' from arguments and invoking the handler.case "get_set": { const { set_code } = args as { set_code: string }; return await handleGetSet(set_code, config); }
- index.ts:269-276 (registration)Includes the GET_SET_TOOL in the array of tools returned by listTools request.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;