Skip to main content
Glama

Correct a trade

edit_trade
DestructiveIdempotent

Corrects a recorded trade's price, quantity or date, as the trade list on the page does: cash moves by the difference, the holding is recomputed, and the journal entry follows where it still matches. fees is what the broker charged; without it the fees are worked out again from the user's settings. The side and the ticker cannot change: that takes deleting the trade and recording the right one. Refused if a sell would then be of shares not held. 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": "edit_trade"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe trade id, from get_trades or record_trade.
feesNoWhat the broker charged. Left out: a fee reported before is kept while price and quantity stay the same; otherwise the estimate.
priceNoPrice per share.
quantityNoShares.
traded_atNoTrade date in the market, YYYY-MM-DD.
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?

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds substantial unannotated behavior: cash adjusts by the difference, holdings are recomputed, the journal entry follows only where it still matches, fees are re-derived when omitted, and the mutation is refused if a resulting sell exceeds shares held. The dry-run/preview handshake is a critical trait no annotation conveys.

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?

Front-loaded with the core action, then the mutation effects, the exclusions, and finally the preview handshake in the position an agent will read last-but-act on first. Dense and mostly waste-free, though the fee sentence and the preview sentence are long enough to invite a second read.

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?

For a destructive mutation with no output schema, the description covers mutation side effects, refusal conditions, immutable fields, fee derivation, and the confirmation workflow. An agent has everything needed to call it safely and correctly without inferring anything.

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 coverage is 100%, so the schema already documents all six parameters and the baseline is 3. The description does add real semantics for fees, but its phrasing ('without it the fees are worked out again from the user's settings') is a simplification that sits awkwardly against the schema's more precise rule (a previously reported fee is kept while price and quantity are unchanged), adding mild noise rather than clarity.

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?

Opens with a specific verb+resource and enumerates the mutable fields (price, quantity, date), then explicitly states the immutable ones (side, ticker), which is exactly the boundary that separates it from delete_trade and record_trade. An agent can distinguish it from every sibling without opening a schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use (fix price/quantity/date), when-not (side/ticker change), the alternative that handles the excluded case (delete then re-record), and the exact two-call preview protocol including the fact that omitting preview_id changes nothing. That is a complete routing rule.

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.