Skip to main content
Glama
screener-mcp
by LogeshR15

update_portfolio_stock

Idempotent

Overwrite quantity or average price for an existing holding to reflect a partial sell or correct a recorded cost basis. Use for updates, not new buy lots.

Instructions

Overwrite quantity and/or average price for an existing holding — e.g. after a partial sell (set the new remaining quantity) or to correct your recorded cost basis.

Use add_portfolio_stock instead for a new buy lot — it recalculates the average price for you rather than replacing it.

symbol: NSE/BSE symbol already in your portfolio quantity: new total share count (0 = leave unchanged) avg_price: new average price (0 = leave unchanged)

Examples: update_portfolio_stock("RELIANCE", quantity=5) # sold half update_portfolio_stock("TCS", avg_price=3750) # correct cost basis

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": {
      "symbol": "<symbol>"
    },
    "name": "update_portfolio_stock"
  }
}

Input Schema

NameRequiredDescriptionDefault
symbolYes
quantityNo
avg_priceNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=true and destructiveHint=false, so safety is covered structurally. The description adds genuinely new behavior: it replaces the stored average price rather than recalculating it, and the symbol must already exist in the portfolio. It stops short of saying what happens if the symbol is absent.

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?

Front-loaded with the core action, then the sibling distinction, then a compact per-parameter glossary, then two runnable examples. Every block adds information; nothing is redundant.

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?

Complete enough for a simple 3-parameter mutation: prerequisites, alternatives, and parameter sentinels are all stated, and the output schema means return values need no prose. The one real gap is that, with 0 meaning 'leave unchanged', the description never addresses how to zero out or clear a holding, nor the error path for an unknown symbol.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full parameter burden and does it: it defines each of the three parameters and discloses the non-obvious sentinel semantics (0 = leave unchanged) that the schema's bare defaults do not convey.

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 (overwrite) plus the exact resources affected (quantity and/or average price) for an existing holding, and explicitly contrasts itself with add_portfolio_stock. An agent can distinguish this from the sibling without opening either 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 cases (after a partial sell, correcting cost basis) and names the concrete alternative for the opposite case: use add_portfolio_stock for a new buy lot. The two examples further anchor the decision.

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