Skip to main content
Glama
hamzafaiz17

TradeZylo MCP Server

by hamzafaiz17

close_trade

Close an open trade by recording its exit price in TradeZylo journal; realized PnL, actual R:R, and account balance update automatically.

Instructions

[WRITE ACTION] Close an open trade in TradeZylo journal by recording the exit price. Backend automatically calculates realized PnL ($ and %), actual R:R multiple, and updates account balance. Returns full updated trade record and refreshed account balance.

Example questions:

  • "Close my open EUR/USD trade at 1.0890"

  • "Close trade at exit price 65200"

  • "I just exited my gold long at 2365, mark it closed with notes: hit target cleanly"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mistakesNoExecution mistakes if any e.g. ["Exited Early", "Chasing"]
trade_idNoUnique trade UUID. If omitted, search by instrument symbol.
exit_timeNoExit ISO timestamp (defaults to current time)
exit_priceYesExact exit execution price
instrumentNoSymbol (e.g. "EUR/USD", "BTCUSDT") to find open trade if trade_id is not known.
emotion_exitNoEmotion at exit e.g. "Satisfied", "Disciplined", "Frustrated", "Relieved"
lesson_learnedNoKey lesson learned from this trade
notes_posttradeNoPost-trade review or exit commentary

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it flags '[WRITE ACTION]', discloses server-side side effects (realized PnL $/%, actual R:R, account balance update) and states the return payload. It omits reversibility and any permission/account-state prerequisites (e.g. frozen account).

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 write-action flag, then effect, then return, then illustrative examples. Efficient overall, though the third example's embedded instruction ('mark it closed with notes') is slightly verbose relative to the rest.

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?

For an 8-parameter mutation tool with no output schema, the description covers action, side effects, return shape, and realistic invocation examples. It lacks only guard conditions (auth, irreversible close semantics) and any mention of related tools for correcting a mis-closed trade.

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%, so every one of the 8 parameters is already documented in the schema, including trade_id-vs-instrument fallback logic. The description adds behavioral outcome context but no syntax or format detail beyond the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: 'Close an open trade in TradeZylo journal by recording the exit price.' It is distinguishable from siblings like log_trade and update_trade by the 'close an open trade' scope, though it never names those alternatives explicitly.

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?

The example questions ('Close my open EUR/USD trade at 1.0890', 'Close trade <trade_id> at exit price 65200') clearly demonstrate invocation contexts, including using trade_id vs instrument. No explicit when-not-to-use or alternative tool guidance is given.

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