Skip to main content
Glama
matteoantoci

MCP Bitpanda Server

list_crypto_wallets

Retrieve all cryptocurrency wallet details from your Bitpanda account to view balances and holdings.

Instructions

Lists all user's crypto wallets from the Bitpanda API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the tool logic: fetches user's crypto wallets from Bitpanda API endpoint /wallets using API key and axios.
    const listCryptoWalletsHandler = async (_input: Input): Promise<Output> => { try { const apiKey = getBitpandaApiKey(); const url = `${BITPANDA_API_BASE_URL}/wallets`; // Note: API uses /wallets for crypto 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 crypto wallets:', error); const message = error instanceof Error ? error.message : 'An unknown error occurred while fetching crypto wallets.'; // Re-throwing the error to be handled by the MCP server framework throw new Error(`Failed to fetch Bitpanda crypto wallets: ${message}`); } };
  • Input schema (empty object, no parameters) and Zod-inferred Input type, plus Output type matching Bitpanda API response structure.
    // Define the input schema shape for the list_crypto_wallets tool (no parameters) const listCryptoWalletsInputSchemaShape = {}; type RawSchemaShape = typeof listCryptoWalletsInputSchemaShape; type Input = z.infer<z.ZodObject<RawSchemaShape>>; // Define the expected output structure based on the API documentation type Output = { data: Array<{ type: string; attributes: { cryptocoin_id: string; cryptocoin_symbol: string; balance: string; is_default: boolean; name: string; pending_transactions_count: number; deleted: boolean; }; id: string; }>; };
  • Tool definition object that bundles the name 'list_crypto_wallets', description, schema, and handler for export.
    // Export the tool definition for list_crypto_wallets export const listCryptoWalletsTool: BitpandaToolDefinition = { name: 'list_crypto_wallets', description: "Lists all user's crypto wallets from the Bitpanda API.", inputSchemaShape: listCryptoWalletsInputSchemaShape, handler: listCryptoWalletsHandler, };
  • Inclusion of listCryptoWalletsTool in the array of all Bitpanda tool definitions.
    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 ];
  • Function that registers all tools, including list_crypto_wallets, with the MCP server using server.tool() for each.
    /** * Registers all Bitpanda tools with the MCP server. * @param server The McpServer instance. */ 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); } }); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/matteoantoci/mcp-bitpanda'

If you have feedback or need assistance with the MCP directory API, please join our Discord server