Skip to main content
Glama

sell

Destructive

Record a sell transaction in the ledger to reduce a holding's units and credit cash. Use after executing a trade at your broker.

Instructions

Record a sell in the local ledger: reduces the position's units (average cost unchanged) and credits cash in the holding's cost currency. Bookkeeps a trade already executed at the user's broker — openInvest never places real orders.

Confirm symbol, units, and price with the user before calling; this moves ledger cash.

Args: symbol: yfinance ticker of an existing holding. units: Quantity sold; must be > 0. price: Execution price per unit, in the holding's cost currency.

Returns: Updated position summary, or {"status": "error", "error": ...}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
priceYesExecution price per unit, in the holding's cost currency.
unitsYesQuantity sold; must be > 0.
symbolYesyfinance ticker of an existing holding.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The description discloses that the tool is destructive (reduces units, moves cash) and requires user confirmation, aligning with the destructiveHint annotation. It adds nuanced context about ledger movement and the absence of real order placement, going beyond the annotation.

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?

The description is concise and well-structured: a single paragraph explaining purpose and caution, followed by clearly labeled arguments and return value. Every sentence is informative and earns its place.

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?

The description covers behavior, parameters, preconditions, return type, and limitations (no real orders). With the presence of an output schema and the annotations, the description is fully complete and leaves no gaps.

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?

The input schema covers all three parameters with descriptions (100% coverage). The description repeats these descriptions verbatim without adding new constraints or clarifications, so it does not add value beyond the schema.

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 clearly states the verb 'Record a sell' and resource 'local ledger', explains the effects (reduces units, credits cash), and distinguishes from real trading by noting 'openInvest never places real orders'. It is specific and unambiguous.

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 description provides clear context: it is for bookkeeping an already executed trade, not for placing orders. It also mandates user confirmation before calling. However, it does not explicitly contrast with the sibling tool 'buy' or state when not to use this tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/longsizhuo/openInvest'

If you have feedback or need assistance with the MCP directory API, please join our Discord server