Skip to main content
Glama
meteoroh

tossinvest-mcp

by meteoroh

Cancel an open order

tossinvest_cancel_order
DestructiveIdempotent

Cancel an open or partially filled order by order ID to withdraw the unfilled remainder and protect against unintended trades. Confirm the real order cancellation first.

Instructions

Cancel a working order. This cancels a REAL order — confirm with the user first.

Args:

  • order_id (string): the order to cancel. Get it from tossinvest_list_orders with status='OPEN'.

  • account_seq (number, optional): resolved automatically for single-account credentials.

  • response_format ('markdown' | 'json'): default 'markdown'.

Returns { accountSeq, orderId, operation: 'canceled' }.

A partially filled order can still be cancelled — the unfilled remainder is withdrawn and the filled part stands. Read execution.filledQuantity on the order afterwards to see what actually traded.

Errors: 409 already-filled (nothing left to cancel), 409 already-canceled, 409 already-processing, 422 cancel-restricted, 404 order-not-found.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_idYesIdentifier of the working order to cancel.
account_seqNoaccountSeq of the account to act on (the `X-Tossinvest-Account` header). Optional: falls back to TOSSINVEST_ACCOUNT_SEQ, then to the sole account on the credentials. Get valid values from tossinvest_list_accounts.
response_formatNoOutput format: 'markdown' for a compact human-readable summary, 'json' for the complete raw payload.markdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNo
orderIdYesIdentifier of the resulting order
operationYescreated, modified or canceled
accountSeqYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations by warning that the order is real and requires user confirmation, explaining partial-fill cancellation semantics, directing the agent to read execution.filledQuantity, and enumerating specific error codes. The idempotentHint is not contradicted because repeated cancels do not change state even if they return 409.

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?

Structured into Args, Returns, and Errors sections with the critical real-order warning front-loaded. Every sentence carries operational value; the length is justified by the destructive nature and the partial-fill edge case.

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

Completeness5/5

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

Given that an output schema exists, the description still provides the return shape, error semantics, partial-fill behavior, and parameter sourcing. An agent has everything needed to call the tool safely and interpret its result.

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

Parameters4/5

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

The schema already documents all three parameters at 100% coverage, but the description adds cross-tool sourcing for order_id, auto-resolution behavior for account_seq, and the default output format. This extra guidance helps the agent choose correct values beyond the bare schema.

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') and resource ('working order'), and explicitly warns it acts on a REAL order. It is clearly distinct from tossinvest_modify_order and tossinvest_cancel_conditional_order by targeting non-conditional working 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?

Provides explicit sourcing for order_id ('Get it from tossinvest_list_orders with status='OPEN'') and instructs the agent to confirm with the user before canceling. It does not name alternatives like tossinvest_cancel_conditional_order, but the working-order scope makes the intended use reasonably clear.

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