Skip to main content
Glama

Add Several to Portfolio

add_to_watchlist_batch

Add a list of companies the person gave you, up to 100 rows, to one of their StockLens portfolios, in two calls. First call with confirm false: nothing is added and every row returns its outcome. Relay summary_line and message, then every row that is not a plain add, grouped by outcome, and name the plain adds in one line; name the portfolio only when portfolio_count is above 1. Ask which rows to add. Then call with confirm true, the preview_id, the same rows, the same portfolio and the confirmed_indexes the person approved. Send only rows the person gave you. For an ambiguous row, ask which listing using its candidates; never pick one. Add a not_covered row only if the person asks for it. A changed list or a different portfolio needs a new preview; preview_mismatch means the preview expired or no longer matches, so preview again. Without portfolio_id or portfolio_name it uses the default portfolio. It does not trade, record holdings or move money.

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": {
      "rows": "<rows>",
      "confirm": "<confirm>"
    },
    "name": "add_to_watchlist_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
rowsYesThe companies the person gave you, one per row, in their order. Never add a row they did not name.
confirmYesfalse previews the list and adds nothing. true adds the rows of confirmed_indexes from the preview that preview_id names.
preview_idNoThe preview_id the preview returned. Required when confirm is true.
portfolio_idNoThe id of the portfolio to add to, as get_portfolio_insights lists it. Optional: without it or portfolio_name the list goes to the default portfolio.
portfolio_nameNoThe name of the portfolio to add to, as the person names it (exact, case does not matter). Optional.
confirmed_indexesNoThe index of every row the person approved, from the preview. Required when confirm is true.

Output Schema

NameRequiredDescriptionDefault
rowsNo
scopeYes
reasonNo
statusYes
messageNo
summaryNo
capacityNo
next_stepNo
is_defaultNo
portfoliosNo
preview_idNo
portfolio_idNo
summary_lineNo
company_countNo
portfolio_nameNo
portfolio_countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • removedOutput schema / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / capacity / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / next_step / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / next_step / properties / arguments / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / portfolios / items / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / rows / items / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / rows / items / properties / candidates / items / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / rows / items / properties / listing / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / summary / additionalProperties
      Removed value: -false
  2. Added

TDQS

A4.6/5.0
Behavior4/5

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

Adds real behavior beyond the annotations: the preview call mutates nothing, the preview can expire or mismatch, a changed list or portfolio invalidates it, and the tool 'does not trade, record holdings or move money.' One gap remains — idempotentHint is false, yet the description never says whether confirming the same preview_id twice would duplicate rows or be rejected.

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 the two-call model, then the relay rules, then the error paths — a logical order with no filler sentences. It is dense to the point of being run-on in the middle section, where the relay instructions compress several distinct obligations into one long clause chain.

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?

For a 6-parameter, non-idempotent mutation with a preview gate, the description covers sequencing, required companions, error recovery, defaults, and scope limits. With an output schema present, it needn't document return shapes, and it still names the key response fields (summary_line, message, portfolio_count, candidates) that drive the next turn.

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 workflow meaning the schema alone does not: confirm false vs true as a preview/apply split, preview_id as the binding to a prior preview, confirmed_indexes as the approved subset, and portfolio_count driving whether the portfolio name must be spoken. Row-level semantics (query/exchange) are left to the schema, which already documents them well.

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 ('Add a list of companies... to one of their StockLens portfolios'), the batch limit (up to 100 rows), and the two-call shape. This clearly distinguishes it from the singular sibling add_to_watchlist without needing to name it.

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?

Explicitly prescribes the when/when-not flow: first call with confirm false, relay results, ask which rows to add, then call with confirm true plus preview_id and confirmed_indexes. It also covers edge routing — ambiguous rows must be asked about using candidates, never picked; not_covered rows only on request; preview_mismatch requires re-previewing; missing portfolio_id/name falls back to the default portfolio.

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.

Resources