get_sets
Retrieve detailed information on all Magic: The Gathering card sets, organized by release date in descending order, to support applications or workflows needing comprehensive card data.
Instructions
返回所有MTG卡牌系列的完整数据,按发布日期降序排列
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_sets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.ts:357-361 (handler)The main execution function for the 'get_sets' tool. It constructs the API URL for fetching all sets and calls the shared response handler.
async function handleGetSets(config?: z.infer<typeof configSchema>) { const url = `${config?.apiUrl || BASE_URL}/sets`; const response = await fetch(url); return handleSbwszResponse(response); } - index.ts:166-179 (schema)The Tool object defining the 'get_sets' tool, including its name, description, empty inputSchema (no parameters required), and annotations.
const GET_SETS_TOOL: Tool = { name: "get_sets", description: "返回所有MTG卡牌系列的完整数据,按发布日期降序排列", inputSchema: { type: "object", properties: {}, required: [] }, annotations: { title: "获取所有卡牌系列", readOnlyHint: true, openWorldHint: true } }; - index.ts:511-513 (registration)Registration of the 'get_sets' handler in the switch statement within the CallToolRequestSchema handler.
case "get_sets": { return await handleGetSets(config); } - index.ts:269-276 (registration)Inclusion of GET_SETS_TOOL in the SBWSZ_TOOLS array, which is returned by listTools and used for tool discovery.
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:487-489 (registration)MCP server registration for ListToolsRequestSchema, which provides the list of tools including 'get_sets'.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: SBWSZ_TOOLS }));