get_withdrawals_by_ids
Retrieve specific withdrawal transaction details from the Bitso cryptocurrency exchange by providing transaction identifiers, enabling users to access and verify withdrawal information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/bitso-tools.ts:238-300 (handler)Handler function that validates input using Zod schema, fetches withdrawals by passing comma-separated wids as wid to client.getWithdrawals, and returns formatted JSON or error.async (params): Promise<ToolResult> => { try { const validatedParams = GetWithdrawalsByIdsSchema.parse(params); logToFile('INFO', 'Get withdrawals by IDs tool called', { wids: validatedParams.wids }); const response = await client.getWithdrawals({ wid: validatedParams.wids }); if (!response.success || !response.payload || response.payload.length === 0) { return { content: [ { type: "text", text: "No withdrawals found with the specified IDs." } ] }; } return { content: [ { type: "text", text: JSON.stringify({ success: true, count: response.payload.length, withdrawals: response.payload.map(withdrawal => ({ wid: withdrawal.wid, status: withdrawal.status, currency: withdrawal.currency, amount: withdrawal.amount, method: withdrawal.method, created_at: withdrawal.created_at, origin_id: withdrawal.origin_id || null })) }, null, 2) } ] }; } catch (error) { logToFile('ERROR', 'Error in get_withdrawals_by_ids tool', error); if (error instanceof z.ZodError) { const errorMessage = error.errors.map(err => `${err.path.join('.')}: ${err.message}`).join(', '); return { content: [ { type: "text", text: `Validation error: ${errorMessage}` } ] }; } return { content: [ { type: "text", text: `Error retrieving withdrawals: ${error instanceof Error ? error.message : String(error)}` } ] }; } }
- src/tools/bitso-tools.ts:23-25 (schema)Zod schema for input validation requiring a string of comma-separated withdrawal IDs (wids). Used in the handler for runtime parsing.const GetWithdrawalsByIdsSchema = z.object({ wids: z.string().min(1, "Comma-separated withdrawal IDs are required"), });
- src/tools/bitso-tools.ts:223-237 (registration)MCP server tool registration including the tool name, description, and JSON inputSchema matching the Zod schema.server.tool( "get_withdrawals_by_ids", { description: "Get multiple withdrawals by comma-separated withdrawal IDs", inputSchema: { type: "object", properties: { wids: { type: "string", description: "Comma-separated withdrawal IDs (e.g., 'wid1,wid2,wid3')" } }, required: ["wids"] } },