Skip to main content
Glama
agent-next

polymarket-paper-trader

Cancel limit order

cancel_order
DestructiveIdempotent

Cancel a pending limit order by ID and release its reserved cash, freeing buying power in your paper-trading account. Use cancel_all_orders for every pending order.

Instructions

Cancel one pending limit order by ID and release its reserved cash.

Local change only. Returns a not_found error if the order does not exist or is no longer pending. Use cancel_all_orders to cancel every pending order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountNoPaper account name; any name without '/', '\', '..' or surrounding spaces. Each name is a separate local account. Default 'default'.default
order_idYesID of the pending order, from place_limit_order or list_orders.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.4.13
    • addedInput schema / properties / account / description
      Added value: +"Paper account name; any name without '/', '\\', '..' or surrounding spaces. Each name is a separate local account. Default 'default'."
    • addedInput schema / properties / order_id / description
      Added value: +"ID of the pending order, from place_limit_order or list_orders."
  2. First observedv0.4.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructive=true, idempotent=true and openWorld=false, so the description's added value is the mutation semantics: 'local change only' and the release of reserved cash, plus the not_found failure mode when the order is absent or already filled/cancelled. That is real behavior beyond the annotation flags, though it doesn't quantify anything about timing or concurrency.

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?

Three short sentences with the action and side effect front-loaded, followed by the failure mode and the sibling alternative. No filler or restatement of the tool name.

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?

An output schema exists, so return values need no explanation, and annotations carry the safety profile. The description covers the side effect, the failure mode, and the alternative tool, leaving only minor gaps such as account-scoped behavior for a local multi-account setup.

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%: order_id already documents its origin (place_limit_order or list_orders) and account already documents its naming rules and default. The description only restates 'by ID' and adds no syntax, format, or edge-case detail the schema lacks, so the baseline of 3 applies.

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?

States a specific verb (cancel), resource (one pending limit order), selector (by ID), and a concrete side effect (release its reserved cash). This distinguishes it immediately from cancel_all_orders and from read-only siblings like list_orders.

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

Usage Guidelines4/5

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

Explicitly routes the agent to cancel_all_orders for the bulk case and implicitly limits this tool to orders that are still pending. Clear context for selection, though it doesn't state prerequisites such as account scoping or what to do when the order belongs to a different account than the default.

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