Skip to main content
Glama
lodetomasi

Portfolio Copilot

by lodetomasi

map_holdings_to_targets

Map local portfolio holdings to target allocation buckets by ISIN or name keywords, classifying special instruments as satellite positions and producing current values ready for rebalancing.

Instructions

Map every holding in a local export to a target allocation bucket (portfolio.mapping) by ISIN then by name keywords, using get_portfolio_config()'s targets and config/model_portfolios.yaml's example instruments. Certificates, leveraged instruments and single stocks are reported as satellite positions outside the bucket system -- never silently dropped from coverage. The result's 'current_values' plugs directly into rebalance_portfolio/allocate_cash's current_values parameter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
base_currencyNoEUR
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, and it delivers rich detail: the exact matching order, the dependency on two configuration sources, and the edge-case treatment of certificates, leveraged instruments, and single stocks as satellite positions that are never silently dropped. This goes well beyond what a bare schema would convey.

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?

Three dense sentences with no filler. The core action and matching logic are front-loaded, and each additional clause adds meaningful operational detail such as source configuration, satellite treatment, and downstream integration.

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?

The description covers the matching algorithm, data sources, edge-case handling, and downstream compatibility, which is substantial for a tool with no annotations and no output schema. The main missing piece is a clearer contract for the parameters, especially base_currency, and more explicit detail about the result structure beyond 'current_values'.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for undocumented parameters, but it only indirectly references 'path' through 'local export' and never explains 'base_currency' or accepted formats. While the algorithm details are helpful, they do not clarify what values the two parameters actually take.

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 states a specific verb and resource: mapping every holding in a local export to target allocation buckets. It also specifies the matching strategy ('by ISIN then by name keywords'), which clearly distinguishes it from sibling tools like parse_portfolio_export or rebalance_portfolio that fill different roles in the same workflow.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly explains how the tool fits into a larger workflow: it uses get_portfolio_config() targets and config/model_portfolios.yaml, and its 'current_values' output plugs directly into rebalance_portfolio/allocate_cash. It does not explicitly state when not to use it or name alternatives, but the downstream integration strongly implies the intended usage context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lodetomasi/portfolio-copilot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server