Skip to main content
Glama

Log a trade by hand

journal_add_trade
Idempotent

Log a trade by adding its fills to a manual or import journal account (never a broker-synced one — the sync owns those). The journal derives trades from fills: a long round trip is a buy fill then a sell fill, a short is sell then buy, scale-ins and partial exits are just more fills, and a lone fill opens a position. Times are ISO 8601 instants with offset; fees are per fill. Fills identical to existing ones are skipped as duplicates. Returns the insert counts and the trade(s) the fills now belong to, with keys for journal_update_trade. Correcting or removing an existing fill is done in the app, not here. Requires signing in with a LuxAlgo account (OAuth).

Input Schema

NameRequiredDescriptionDefault
fillsYesThe fills, in any order.
contextYesExplain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as "a user", "the customer", or "an account". Example: "Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution."
accountIdYesA `manual` or `import` account id from journal_list_accounts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing that identical fills are skipped as duplicates (explaining the idempotentHint mechanism), that trades are derived from fill sequences (long/short round trips, scale-ins, lone fill opens a position), that OAuth sign-in with a LuxAlgo account is required, and what mutations are impossible here.

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 action and account scope, and every clause carries a behavioral rule rather than filler. It is dense but slightly long, with several rules packed into run-on sentences that could be split for faster scanning.

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 covers the return contract (insert counts plus the trades the fills belong to, with keys for journal_update_trade), auth requirements, dedup behavior, and trade-derivation rules. Nothing an agent needs to call this correctly is missing.

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 the schema already documents accountId and each fill field. The description's notes ('Times are ISO 8601 instants with offset; fees are per fill') restate what the schema already says rather than adding format or constraint detail. Baseline 3 applies when the schema does the heavy lifting.

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 ('Log a trade by adding its fills') and immediately scopes the target accounts ('a `manual` or `import` journal account — never a broker-synced one'). This clearly separates it from siblings like journal_update_trade, journal_get_trade, and journal_list_trades.

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 (logging manual/import trades) and when-not (broker-synced accounts, correcting/removing fills — 'done in the app, not here'). It also names the follow-up tool (journal_update_trade via the returned keys) and the account source (journal_list_accounts).

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.