Skip to main content
Glama
theagoralabs

Theagora MCP Server

by theagoralabs

cancel_order

DestructiveIdempotent

Cancel open exchange orders by providing the order ID to manage trading positions and maintain order book integrity.

Instructions

Cancel one of your open orders on the exchange.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderIdYesThe order ID to cancel

Implementation Reference

  • MCP tool registration and handler for cancel_order. Defines the tool with input schema (orderId string) and executes the cancellation by calling client.cancelOrder(), returning the JSON result.
    // cancel_order — Cancel an open order
    server.tool(
      'cancel_order',
      'Cancel one of your open orders on the exchange.',
      {
        orderId: z.string().describe('The order ID to cancel'),
      },
      { destructiveHint: true, idempotentHint: true, openWorldHint: true },
      async (params) => {
        const result = await client.cancelOrder(params.orderId);
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],
        };
      }
    );
  • HTTP client method that sends a DELETE request to /orders/{orderId} endpoint to cancel the order via the Agora API.
    async cancelOrder(orderId: string): Promise<any> {
      return this.request(`/orders/${orderId}`, { method: 'DELETE' });
    }

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/theagoralabs/mcp'

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