Skip to main content
Glama

Update Portfolio Lot

UpdatePortfolioLot
Destructive

Correct a lot the USER already recorded: a mistyped quantity, price, trade date, note or exchange rate. Only the fields you pass change; the rest are left alone.

The instrument itself cannot be edited: a lot on the wrong stock or the wrong contract is a different holding, so remove it with RemovePortfolioLot and add the right one. To record a sale, use ClosePortfolioLot rather than editing the quantity down, because editing it away loses the realized profit.

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": {
      "portfolio": "<portfolio>",
      "lotId": "<lotId>"
    },
    "name": "UpdatePortfolioLot"
  }
}

Input Schema

NameRequiredDescriptionDefault
noteNoOptional. A replacement note, up to 256 characters.
lotIdYesThe lot id shown by GetMyPortfolio, e.g. a1b2c3d4.
fxRateNoOptional. The broker's exchange rate on the trade, as units of the portfolio's currency per 1 unit of the lot's currency.
quantityNoOptional. The corrected signed size. Negative is a short or written option.
portfolioYesThe portfolio holding the lot, by name.
clearFxRateNoOptional. True removes the broker's exchange rate, so the lot converts at the official rate on its trade date. Cannot be combined with fxRate.
costPerUnitNoOptional. The corrected price per share, always positive.
acquiredDateNoOptional. The corrected trade date, as yyyy-MM-dd.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / clearFxRate
      Added value: +{
      +  "default": false,
      +  "description": "Optional. True removes the broker's exchange rate, so the lot converts at the official rate on its trade date. Cannot be combined with fxRate.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / fxRate
      Added value: +{
      +  "default": null,
      +  "description": "Optional. The broker's exchange rate on the trade, as units of the portfolio's currency per 1 unit of the lot's currency.",
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
  2. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the mutation profile is known; the description adds genuinely new behavior — partial-update semantics ('Only the fields you pass change; the rest are left alone') and the consequence of misusing quantity edits. It stops short of saying whether a correction is reversible or what the response contains, which matters for a destructive tool.

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?

Two tight paragraphs, front-loaded with the verb and scope, then the exclusions. Every sentence carries distinct information — the field list, the partial-update rule, the instrument prohibition, and the sale alternative — with no restatement of the name or title.

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 destructive mutation with no output schema, the description covers the essential decision space: what is editable, what is preserved, and where to go instead for instrument swaps and sales. The remaining gap is post-call behavior — confirmation, errors, or reversibility — which an agent handling a destructive write would benefit from knowing.

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 meaning the schema cannot: it groups the editable fields and carves out an ineligible one (the instrument itself), telling the agent which parameters exist conceptually before it inspects the schema. It does not explain format or interaction details such as the fxRate/clearFxRate conflict, but the schema already documents those.

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 opens with a specific verb and resource — 'Correct a lot the USER already recorded' — and enumerates the correctable fields (quantity, price, trade date, note, exchange rate). It explicitly separates this from instrument changes and from record-keeping via ClosePortfolioLot, so an agent can identify the tool without opening any 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?

Usage routing is explicit: wrong instrument goes to RemovePortfolioLot plus AddPortfolioLot, and recording a sale goes to ClosePortfolioLot rather than an edit. It also implies the when-not condition (a lot the USER already recorded) and warns against a specific misuse pattern that would lose realized profit.

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.