list_withdrawals
Retrieve withdrawal transaction history from the Bitso cryptocurrency exchange to track and monitor outgoing funds with proper authentication.
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": "list_withdrawals"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/bitso-tools.ts:85-151 (handler)Handler function that executes the list_withdrawals tool: validates params with Zod schema, fetches withdrawals via BitsoApiClient, formats and returns JSON response or error messages.
async (params): Promise<ToolResult> => { try { const validatedParams = ListWithdrawalsSchema.parse(params); logToFile('INFO', 'List withdrawals tool called', validatedParams); const response = await client.getWithdrawals(validatedParams); if (!response.success || !response.payload || response.payload.length === 0) { return { content: [ { type: "text", text: "No withdrawals found with the specified criteria." } ] }; } 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, asset: withdrawal.asset || null, network: withdrawal.network || null, protocol: withdrawal.protocol || null })) }, null, 2) } ] }; } catch (error) { logToFile('ERROR', 'Error in list_withdrawals 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 listing withdrawals: ${error instanceof Error ? error.message : String(error)}` } ] }; } } ); - src/tools/bitso-tools.ts:9-17 (schema)Zod input schema for list_withdrawals tool parameters (currency, limit, marker, method, origin_id, status, wid). Used in handler for validation.
const ListWithdrawalsSchema = z.object({ currency: z.string().optional(), limit: z.number().int().positive().max(100).optional(), marker: z.string().optional(), method: z.string().optional(), origin_id: z.string().optional(), status: z.string().optional(), wid: z.string().optional(), }); - src/tools/bitso-tools.ts:45-151 (registration)MCP server tool registration for 'list_withdrawals', including name, description, JSON inputSchema, and inline handler function.
server.tool( "list_withdrawals", { description: "List withdrawals with optional filtering parameters", inputSchema: { type: "object", properties: { currency: { type: "string", description: "Filter by transaction currency" }, limit: { type: "number", description: "Number of objects to return (max 100, default 25)", minimum: 1, maximum: 100 }, marker: { type: "string", description: "Pagination marker" }, method: { type: "string", description: "Filter by withdrawal method" }, origin_id: { type: "string", description: "Filter by client-supplied ID" }, status: { type: "string", description: "Filter by withdrawal status" }, wid: { type: "string", description: "Filter by specific withdrawal ID" } } } }, async (params): Promise<ToolResult> => { try { const validatedParams = ListWithdrawalsSchema.parse(params); logToFile('INFO', 'List withdrawals tool called', validatedParams); const response = await client.getWithdrawals(validatedParams); if (!response.success || !response.payload || response.payload.length === 0) { return { content: [ { type: "text", text: "No withdrawals found with the specified criteria." } ] }; } 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, asset: withdrawal.asset || null, network: withdrawal.network || null, protocol: withdrawal.protocol || null })) }, null, 2) } ] }; } catch (error) { logToFile('ERROR', 'Error in list_withdrawals 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 listing withdrawals: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );