list_fiat_wallets
Retrieve all user's fiat wallets from the Bitpanda API using this tool. Designed for managing and accessing fiat currency data programmatically via the MCP Bitpanda Server.
Instructions
Lists all user's fiat wallets from the Bitpanda API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/fiatWallets.ts:26-46 (handler)The handler function listFiatWalletsHandler that executes the tool logic: fetches user's fiat wallets from Bitpanda API endpoint /fiatwallets using API key.const listFiatWalletsHandler = async (_input: Input): Promise<Output> => { try { const apiKey = getBitpandaApiKey(); const url = `${BITPANDA_API_BASE_URL}/fiatwallets`; const response = await axios.get<Output>(url, { headers: { 'X-Api-Key': apiKey, 'Content-Type': 'application/json', }, }); // Return the data received from the Bitpanda API return response.data; } catch (error: unknown) { console.error('Error fetching Bitpanda fiat wallets:', error); const message = error instanceof Error ? error.message : 'An unknown error occurred while fetching fiat wallets.'; // Re-throwing the error to be handled by the MCP server framework throw new Error(`Failed to fetch Bitpanda fiat wallets: ${message}`); } };
- src/tools/fiatWallets.ts:5-23 (schema)Input schema shape (empty object, no parameters), associated types (RawSchemaShape, Input), and Output type definition matching Bitpanda API response.// Define the input schema shape for the list_fiat_wallets tool (no parameters) const listFiatWalletsInputSchemaShape = {}; type RawSchemaShape = typeof listFiatWalletsInputSchemaShape; type Input = z.infer<z.ZodObject<RawSchemaShape>>; // Define the expected output structure based on the API documentation type Output = { data: Array<{ type: string; attributes: { fiat_id: string; fiat_symbol: string; balance: string; name: string; pending_transactions_count: number; }; id: string; }>; };
- src/tools/fiatWallets.ts:57-62 (registration)Tool definition object listFiatWalletsTool registering the name, description, input schema shape, and handler for use in MCP server.export const listFiatWalletsTool: BitpandaToolDefinition = { name: 'list_fiat_wallets', description: "Lists all user's fiat wallets from the Bitpanda API.", inputSchemaShape: listFiatWalletsInputSchemaShape, handler: listFiatWalletsHandler, };
- src/tools/index.ts:24-35 (registration)Includes listFiatWalletsTool (imported at line 5) in the array of tool definitions used for batch registration with the MCP server.const bitpandaToolDefinitions: BitpandaToolDefinition[] = [ listTradesTool, // Add the listTradesTool to the array listAssetWalletsTool, // Add the listAssetWalletsTool to the array listFiatWalletsTool, // Add the listFiatWalletsTool to the array listFiatTransactionsTool, // Add the listFiatTransactionsTool to the array listCryptoWalletsTool, // Add the listCryptoWalletsTool to the array listCryptoTransactionsTool, // Add the listCryptoTransactionsTool to the array listCommodityTransactionsTool, // Add the listCommodityTransactionsTool to the array assetInfoTool, // Add the assetInfoTool to the array // ohlcTool, // Add the ohlcTool to the array // Other tools will be added here as they are implemented ];
- src/tools/index.ts:41-57 (registration)registerBitpandaTools function that registers all tools from bitpandaToolDefinitions array, including list_fiat_wallets, by calling McpServer.tool() with name, description, schema shape, and wrapped handler.export const registerBitpandaTools = (server: McpServer): void => { bitpandaToolDefinitions.forEach((toolDef) => { try { // Pass the raw shape to the inputSchema parameter, assuming SDK handles z.object() server.tool(toolDef.name, toolDef.description, toolDef.inputSchemaShape, async (input) => { const result = await toolDef.handler(input); // Assuming the handler returns the data directly, wrap it in the MCP content format return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }); console.log(`Registered Bitpanda tool: ${toolDef.name}`); } catch (error) { console.error(`Failed to register tool ${toolDef.name}:`, error); } }); };