zetrix_multi_query
Execute multiple Zetrix blockchain API queries simultaneously to streamline data retrieval and reduce request latency.
Instructions
Execute multiple API queries simultaneously
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Array of query objects |
Implementation Reference
- src/zetrix-client.ts:499-516 (handler)Core handler function that executes the multiQuery by posting the items array to the Zetrix API endpoint /multiQuery and handles response/error.async multiQuery(items: any[]): Promise<any[]> { try { const response = await this.client.post("/multiQuery", { items }); if (response.data.error_code !== 0) { throw new Error( response.data.error_desc || `API Error: ${response.data.error_code}` ); } return response.data.result; } catch (error) { if (axios.isAxiosError(error)) { throw new Error(`Failed to execute multi query: ${error.message}`); } throw error; } }
- src/index.ts:972-985 (handler)MCP server dispatch handler for the tool call, which delegates to zetrixClient.multiQuery and formats the response.case "zetrix_multi_query": { if (!args) { throw new Error("Missing arguments"); } const result = await zetrixClient.multiQuery(args.items as any[]); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:254-267 (registration)Tool registration in the tools array, including name, description, and input schema validation.{ name: "zetrix_multi_query", description: "Execute multiple API queries simultaneously", inputSchema: { type: "object", properties: { items: { type: "array", description: "Array of query objects", }, }, required: ["items"], }, },