Skip to main content
Glama
Derive MCP Server

Derive MCP Server

by yashhsm

replace_order

Atomically cancels an existing order and places a new one, ensuring the new order is created only if cancellation succeeds.

Instructions

Atomically cancel an existing order and create a new one. If cancel fails, the new order is not placed.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "order_id_to_cancel": "<order_id_to_cancel>",
      "instrument_name": "<instrument_name>",
      "direction": "<direction>",
      "amount": "<amount>",
      "limit_price": "<limit_price>"
    },
    "name": "replace_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
amountYesNew order amount
max_feeNoMaximum fee100
directionYesOrder direction
order_typeNolimit
limit_priceYesNew limit price
reduce_onlyNo
time_in_forceNogtc
instrument_nameYesInstrument name
order_id_to_cancelYesOrder ID to cancel
expected_filled_amountNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations provided, the description carries the full behavioral burden. It usefully discloses the atomic failure guarantee: if cancellation fails, the new order is not placed. However, it omits other important mutation details such as permissions, irreversibility, rate limits, and what happens to the new order after successful replacement.

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?

Two short sentences, with the core atomic replacement purpose front-loaded and the failure condition immediately following. There is no unnecessary wording.

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

Completeness2/5

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

For a 10-parameter mutation tool with no annotations and no output schema, the description is too sparse. It explains atomicity but not how the new order's fields are interpreted, what the tool returns, or the permission and failure semantics beyond cancellation failure.

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

Parameters2/5

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

The description adds almost no meaning to the 10 parameters beyond the notion of cancelling one order and creating another. With only 60% schema description coverage, four parameters (reduce_only, time_in_force, order_type, expected_filled_amount) lack documented semantics in both the schema and the description, so the description fails to compensate for the gap.

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 states a specific compound verb and resource: atomically cancel an existing order and create a new one. It clearly distinguishes the operation from the sibling cancel_order and place_order tools by describing the replacement as a single atomic action.

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 atomic replacement context implies when to use this tool, but it never explicitly says to prefer it over calling cancel_order and place_order separately, nor does it state when not to use it. The failure condition is behavioral guidance rather than selection guidance.

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