Skip to main content
Glama
matteoantoci

MCP Bitpanda Server

list_commodity_transactions

Retrieve and paginate your commodity transaction history from Bitpanda, showing newest transactions first to track trading activity.

Instructions

Lists all user's commodity transactions from the Bitpanda API. Newest commodity transactions come first. Response is cursor paginated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoId of the last known commodity transaction by the client. Only commodity transactions after this id are returned. Empty or missing cursor parameter will return commodity transactions from the start.
page_sizeNoSize of a page for the paginated response

Implementation Reference

  • Handler function that fetches commodity transactions from the Bitpanda API endpoint /assets/transactions/commodity using the provided cursor and page_size parameters.
    const listCommodityTransactionsHandler = async (input: Input): Promise<Output> => {
      try {
        const apiKey = getBitpandaApiKey();
        const url = `${BITPANDA_API_BASE_URL}/assets/transactions/commodity`;
    
        const params: any = {}; // Use any for now, refine later if needed
        if (input.cursor) {
          params.cursor = input.cursor;
        }
        if (input.page_size) {
          params.page_size = input.page_size;
        }
    
        const response = await axios.get<Output>(url, {
          headers: {
            'X-Api-Key': apiKey,
            'Content-Type': 'application/json',
          },
          params,
        });
    
        // Return the data received from the Bitpanda API
        return response.data;
      } catch (error: unknown) {
        console.error('Error fetching Bitpanda commodity transactions:', error);
        const message =
          error instanceof Error ? error.message : 'An unknown error occurred while fetching commodity transactions.';
        // Re-throwing the error to be handled by the MCP server framework
        throw new Error(`Failed to fetch Bitpanda commodity transactions: ${message}`);
      }
    };
  • Input schema definition for the tool using Zod, defining optional cursor and page_size parameters.
    const listCommodityTransactionsInputSchemaShape = {
      cursor: z
        .string()
        .optional()
        .describe(
          'Id of the last known commodity transaction by the client. Only commodity transactions after this id are returned. Empty or missing cursor parameter will return commodity transactions from the start.'
        ),
      page_size: z.number().int().positive().optional().describe('Size of a page for the paginated response'),
    };
  • Registers all Bitpanda tools, including list_commodity_transactions, with the MCP server using server.tool() in a loop over the tool definitions.
    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);
        }
      });
    };
  • Defines and exports the tool definition object including name, description, input schema, and handler for registration.
    export const listCommodityTransactionsTool: BitpandaToolDefinition = {
      name: 'list_commodity_transactions',
      description:
        "Lists all user's commodity transactions from the Bitpanda API. Newest commodity transactions come first. Response is cursor paginated.",
      inputSchemaShape: listCommodityTransactionsInputSchemaShape,
      handler: listCommodityTransactionsHandler,
    };
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and adds valuable behavioral context: it specifies that results are sorted with 'newest commodity transactions come first' and that the 'response is cursor paginated.' This discloses key operational traits beyond basic listing, though it could mention rate limits or authentication needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, followed by ordering and pagination details in two concise sentences. Every sentence adds essential information without redundancy, making it efficient and well-structured for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is fairly complete: it covers purpose, ordering, and pagination. However, it lacks details on response format, error handling, or authentication requirements, which would enhance completeness for an API tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents both parameters (cursor and page_size) thoroughly. The description does not add any parameter-specific details beyond what the schema provides, such as syntax examples or default values, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Lists'), resource ('all user's commodity transactions'), and source ('from the Bitpanda API'), distinguishing it from sibling tools like list_crypto_transactions or list_fiat_transactions by specifying commodity transactions. It provides a complete purpose statement without being tautological.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving commodity transactions in a paginated, newest-first order, but does not explicitly state when to use this tool versus alternatives (e.g., compared to list_trades or other transaction types). It offers some context through ordering and pagination, but lacks explicit guidance on prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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