Skip to main content
Glama
mothanaprime

Portfolio Rotation MCP Server

by mothanaprime

compare_swaps

Identifies optimal portfolio swaps by comparing scored tickers against current holdings, recommending swaps when a candidate's score exceeds the holding's score by a set threshold.

Instructions

Generate pairwise swap recommendations from scored tickers.

Compares each holding against each candidate. Recommends a swap when the candidate's composite score exceeds the holding's score by >= threshold.

Args: scores_json: JSON array of score dicts from score_tickers tool. holdings: Comma-separated current holding tickers. candidates: Comma-separated candidate tickers. threshold: Minimum score delta to recommend a swap (default 15).

Returns: JSON with swap recommendations and full scorecard ranking.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scores_jsonYes
holdingsYes
candidatesYes
thresholdNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description discloses the core behavior: pairwise comparison using composite scores and a threshold. It notes that scores_json is expected from score_tickers. It does not cover edge cases (e.g., missing tickers) or state side effects, but the main logic is transparent.

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 starts with a clear one-line summary, followed by a brief algorithm explanation, then a well-formatted Args list. Every sentence adds necessary information without redundancy.

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 algorithm, parameter semantics, output format (JSON with recommendations and scorecard), and ties to the preceding score_tickers tool. With output schema present, return details are optional. Minor gaps: no mention of error handling or behavior when no swaps meet threshold.

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

Parameters5/5

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

Schema coverage is 0%, so the description fully compensates. The Args section explains the source of each parameter (scores_json from score_tickers), format (holdings/candidates as comma-separated), and default behavior (threshold default 15). This adds crucial meaning beyond the bare schema types.

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 'Generate pairwise swap recommendations from scored tickers,' which clearly identifies the verb (generate) and resource (swap recommendations). It distinguishes from siblings like score_tickers (which produces scores) and run_backtest (backtesting), making the purpose specific and non-overlapping.

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?

The description explicitly explains when to use: after obtaining scores from score_tickers, to compare holdings vs candidates. It details the algorithm (threshold-based swap). However, it does not discuss when not to use it or mention alternative tools (e.g., analyze_risk for risk-only analysis), slightly limiting guidance.

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/mothanaprime/Rebalance-MCP'

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