Skip to main content
Glama

optimize_portfolio_default

Read-only

Build a risk-optimized portfolio from a list of tickers — fast, synchronous, no LLM.

THE DEFAULT optimizer route. Returns the result directly and almost instantly
(no task id, no polling). Reach for `optimize_portfolio` instead only when you
explicitly want the slower LLM-curated variant layered on top of the optimizers.

Symbols are validated against the covered universe; unsupported tickers come back
in `missing`, and in-universe tickers with too little price history come back in
`dropped`.

No auth required (public endpoint).

Synchronous. Returns:
  {"status": "OK",  # or "SKIPPED"/"EMPTY" when too few usable symbols remain
   "holdings": [{"symbol", "source_strategies", "summary", "conviction_level"}, ...],
   "optimizer_results": {"mvo": {...weights+diagnostics}, "hrp": {...}, "mcvar": {...}},
   "risk_profiles": {"profiles": [...], "recommended": "..."},  # present only when status == "OK"
   "dropped": [...],   # in-universe but insufficient price history
   "missing": [...]}   # not in the covered universe

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolsYesTickers to optimize, e.g. ["AAPL", "MSFT", "JNJ"] (see list_options("tickers")).
risk_toleranceNoWhich risk profile is marked as recommended; omit for the optimizer default.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonNoWhy the run was SKIPPED.
statusYesOK, or SKIPPED / EMPTY when too few usable symbols remain.
droppedNoIn-universe tickers with insufficient price history.
missingNoTickers not in the covered universe.
holdingsNoThe usable holdings that were optimized.
max_weightNoPer-name weight cap the optimizers applied.
risk_profilesNo{profiles: [{risk_profile, method, description, diagnostics, allocation}], recommended}; present only when status is OK.
optimizer_resultsNoPer optimizer (mvo, hrp, mcvar): weights plus diagnostics. Empty unless OK.
lookback_trading_daysNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only supply readOnlyHint, and the description adds substantially beyond that: synchronous execution with no task id or polling, no auth required on a public endpoint, symbol validation against a covered universe, and status semantics (OK/SKIPPED/EMPTY) for degenerate inputs. This is real behavioral disclosure the structured fields do not carry.

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 purpose and the sibling disambiguation in the first two sentences, followed by only the constraints an agent needs. The layout is scannable and no sentence is filler.

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 synchronous, 2-parameter public endpoint, the description covers routing, execution model, auth, and error semantics; with an output schema present it need not have restated the return shape, so nothing required is missing.

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 description coverage is 100%, so the baseline is 3, but the description adds meaning the schema lacks: symbols are validated against a covered universe, with unsupported tickers surfacing in `missing` and low-history tickers in `dropped`. It says nothing extra about `risk_tolerance`, which the schema already documents 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?

"Build a risk-optimized portfolio from a list of tickers" states a specific verb and resource, and the definition explicitly positions itself as "THE DEFAULT optimizer route" versus the `optimize_portfolio` sibling. An agent can distinguish the two tools 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?

It names the alternative explicitly ("Reach for `optimize_portfolio` instead only when you explicitly want the slower LLM-curated variant") and gives the exact condition that selects it. When-to-use and when-not-to-use are both spelled out.

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