Skip to main content
Glama
matteoantoci

MCP Bitpanda Server

list_trades

Retrieve and view your complete trading history from Bitpanda, with paginated results showing newest trades first for easy tracking.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoOne of `buy` or `sell`
cursorNoId of the last known trade by the client. Only trades after this id are returned. Empty or missing cursor parameter will return trades from the start.
page_sizeNoSize of a page for the paginated response

Implementation Reference

  • Handler function that fetches trades from the Bitpanda API endpoint '/trades' using the provided input parameters (type, cursor, page_size), handles errors, and returns the paginated response.
    const listTradesHandler = async (input: Input): Promise<Output> => {
      try {
        const apiKey = getBitpandaApiKey();
        const url = `${BITPANDA_API_BASE_URL}/trades`;
    
        const params: any = {}; // Use any for now, refine later if needed
        if (input.type) {
          params.type = input.type;
        }
        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', // Assuming JSON content type
          },
          params,
        });
    
        // Return the data received from the Bitpanda API
        return response.data;
      } catch (error: unknown) {
        console.error('Error fetching Bitpanda trades:', error);
        const message = error instanceof Error ? error.message : 'An unknown error occurred while fetching trades.';
        // Re-throwing the error to be handled by the MCP server framework
        throw new Error(`Failed to fetch Bitpanda trades: ${message}`);
      }
    };
  • Zod input schema shape defining optional parameters: type (buy/sell), cursor (pagination), page_size.
    const listTradesInputSchemaShape = {
      type: z.enum(['buy', 'sell']).optional().describe('One of `buy` or `sell`'),
      cursor: z
        .string()
        .optional()
        .describe(
          'Id of the last known trade by the client. Only trades after this id are returned. Empty or missing cursor parameter will return trades from the start.'
        ),
      page_size: z.number().int().positive().optional().describe('Size of a page for the paginated response'),
    };
  • Exports the tool definition object for 'list_trades', bundling name, description, input schema shape, and handler reference for use in registration.
    export const listTradesTool: BitpandaToolDefinition = {
      name: 'list_trades',
      description: "Lists all user's trades from the Bitpanda API. Newest trades come first. Response is cursor paginated.",
      inputSchemaShape: listTradesInputSchemaShape,
      handler: listTradesHandler,
    };
  • Registers all Bitpanda tools (including list_trades via the bitpandaToolDefinitions array) with the MCP server by calling server.tool() for each.
    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);
        }
      });
    };
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context: it specifies ordering ('Newest trades come first') and pagination behavior ('Response is cursor paginated'), which are not covered by the schema. However, it lacks details on permissions, rate limits, or error handling, leaving gaps for a tool with no annotation support.

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 in the first sentence, followed by ordering and pagination details in two concise sentences. Every sentence adds value without redundancy, making it efficient and well-structured.

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

Completeness3/5

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

Given no annotations and no output schema, the description partially compensates by explaining ordering and pagination. However, for a tool with 3 parameters and no structured output information, it should ideally cover more behavioral aspects like response format or error cases to be fully complete.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description does not add any parameter-specific semantics beyond what the schema provides, such as explaining interactions between parameters or default values. Baseline 3 is appropriate when the schema does the heavy lifting.

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 verb 'Lists' and the resource 'all user's trades from the Bitpanda API', specifying the scope as the user's trades. It distinguishes from siblings like list_asset_wallets or list_crypto_transactions by focusing specifically on trades rather than wallets or transaction types.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives such as list_crypto_transactions or list_fiat_transactions, which might overlap in functionality. It mentions cursor pagination but does not specify prerequisites or exclusions for usage.

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