Skip to main content
Glama

Delete a trade

delete_trade
DestructiveIdempotent

Deletes a trade recorded by mistake, as the trade list on the page does: the cash it moved goes back, the holding is recomputed, and a buy's journal entry goes with it while it is still exactly that buy. A deleted sell does not reopen the journal entries it closed. A buy whose shares a later sell used is refused until that sell is changed. Sent without preview_id, it changes nothing and returns a preview of the change with a preview_id; sent again with the same arguments and that preview_id, it makes the change.

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": {
      "id": "<id>"
    },
    "name": "delete_trade"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe trade id, from get_trades or record_trade.
preview_idNoThe preview_id that the same call without it returned. Without it, nothing is changed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the destructiveHint/idempotentHint annotations: it discloses downstream effects (cash reversal, holding recomputation, journal entry removal), cascade boundaries (a deleted sell does not reopen closed entries), and the two-phase preview/commit protocol with its idempotent replay semantics. This is exactly the behavioral context an agent needs before a destructive call.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One dense paragraph, but front-loaded with the operation and side effects before the preview mechanics. Every sentence carries distinct information; the journal-entry clauses are wordy but not removable without losing a real behavior.

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?

With no output schema, the description supplies the return behavior itself (a preview object containing a preview_id). Combined with the refusal rules and side effects, an agent has everything needed to call it correctly on the first try.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: it explains the preview_id round-trip contract (same arguments plus the returned preview_id commits the change) rather than merely restating that a preview_id is accepted. The id parameter's provenance is already in the schema, so no extra credit there.

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 and resource ("Deletes a trade") plus the intent qualifier "recorded by mistake," which cleanly separates it from edit_trade in the sibling list. An agent can identify the operation without opening the schema.

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?

Gives clear when-to-use (correcting a mistaken trade) and explicit refusal conditions (deleting a buy whose shares a later sell used). It does not explicitly route to edit_trade or record_trade as the alternative for corrections, so the comparison is implied rather than stated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.