Skip to main content
Glama

Compare portfolios side by side

compare_portfolios
Read-onlyIdempotent

Two to eight separate portfolios on one shared window of prices. In: {label: {ticker: weight}}. Out: growth, volatility, worst fall, and how each moved against the others. Typical questions: 'Compare 60/40 with an all-world fund.'; 'Which of these three mixes fell less in 2022?'; 'Put my portfolio next to the S&P 500.'. Instead: for one portfolio before and after a change, test_a_change or check_before_you_buy. It does not recommend, predict or calculate tax.

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": {
      "portfolios": "<portfolios>"
    },
    "name": "compare_portfolios"
  }
}

Input Schema

NameRequiredDescriptionDefault
baseNoCurrency code every figure is expressed in: USD, EUR, GBP, CAD… Default USD.
portfoliosYesTwo to eight portfolios, {label: {ticker: weight}}. Labels are shortened to letters and digits.

Output Schema

NameRequiredDescriptionDefault
endNoShared window end.
dataNoWhere the prices came from and what was missing or repaired.
startNoShared window start.
_fenceYesWhat these figures are and are not: descriptive, no forecast, no advice. Repeat its sense when presenting the result.
seriesNoPer portfolio label: the growth path over the window.
metricsNoPer portfolio label: growth, volatility, worst fall and related figures.
correlationNoPer pair of labels: how the portfolios moved together.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / base / description
      Previous value: -"Currency every figure is expressed in (USD, EUR, GBP, CAD…). Default USD."New value: +"Currency code every figure is expressed in: USD, EUR, GBP, CAD… Default USD."
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds genuine context beyond that: the 2-8 portfolio limit, the input shape, the measures returned including cross-portfolio co-movement, and an explicit negative capability boundary. Minor gap: nothing about how a window or date range is chosen, though no such parameter exists.

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 input and output contract, then alternatives, then exclusions – a sensible order with little waste. The inline 'In: {label: {ticker: weight}}' duplicates the schema slightly and reads awkwardly, but overall it is tight.

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?

An output schema exists, so return values need not be spelled out, yet the description still names the four headline measures and the cross-portfolio comparison. Input format, cardinality limit, use cases and exclusions are all covered for a tool with nested object parameters.

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?

Schema coverage is 100% and both parameters (base currency default USD, portfolios map) are documented in the schema, including label shortening. The description restates the {label: {ticker: weight}} shape and the 2-8 limit but adds no syntax or weighting semantics beyond what the schema already says, so baseline 3 applies.

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 with scope: two to eight portfolios measured on one shared window of prices. That scope, plus the output measures listed, makes it immediately distinguishable from single-portfolio siblings like measure_portfolio.

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 concrete example questions that select this tool, and explicitly routes the adjacent case (one portfolio before/after a change) to test_a_change or check_before_you_buy. Also states what the tool does not do: no recommendations, predictions or tax.

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