Skip to main content
Glama
Satsuj1n

xp-mcp

by Satsuj1n

calculate_allocation_drift

Compare current portfolio allocation to a target and get per-class drift in percentage points and BRL, with BUY/SELL rebalance actions. Optional tolerance marks small drifts ok.

Instructions

Compare current portfolio allocation against a target defined in ~/.xp-mcp/allocation.json. Returns per-class drift in percentage points and BRL, with suggested BUY/SELL actions to rebalance. Optional 'target_path' argument overrides the default location. Optional 'tolerance_pp' field in the JSON treats drifts within the band as 'ok' (no action).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
target_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It states that the tool returns drift and suggestions, implying a read-only operation, but it does not explicitly mention side effects or confirm no modifications are made. This is adequate but not fully explicit.

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?

The description is concise and well-structured, using two sentences to cover purpose, parameter details, and output. Every sentence adds value with no redundancy or fluff.

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?

For a tool with no output schema, the description sufficiently describes the return (per-class drift in percentage points and BRL, plus BUY/SELL suggestions). It omits details about error handling or edge cases, but these are not critical for a basic understanding. The description is complete enough for an agent to invoke the tool correctly.

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?

The description explains the only parameter, 'target_path', as an optional override for the default location. It also clarifies the 'tolerance_pp' field in the config file, adding semantic meaning. The description does not specify the default location, which is a minor gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's core function: comparing current portfolio allocation to a target file and returning per-class drift with BUY/SELL suggestions. It is specific and easily distinguishable from sibling tools, though it could be slightly more explicit about the expected output format.

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

Usage Guidelines3/5

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

The description provides guidance on optional parameters: 'target_path' to override the default and 'tolerance_pp' as a field in the target file to treat drifts within a band as 'ok'. However, it does not explicitly state when to prefer this tool over siblings like 'get_portfolio_summary' or 'suggest_buys', leaving some inference required.

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