Skip to main content
Glama
mothanaprime

Portfolio Rotation MCP Server

by mothanaprime

run_pipeline

Execute a complete portfolio rotation analysis pipeline: refresh prices, score holdings and candidates across five dimensions, assess risk, generate swap recommendations, backtest, and produce a summary report.

Instructions

Run the full 6-stage rotation analysis pipeline.

Stages: refresh (fetch prices) -> score (5-dimension scoring) -> risk (concentration/correlation) -> compare (swap recommendations) -> backtest (historical simulation) -> report (markdown summary).

This is the main entry point for a complete rotation analysis.

Args: portfolio_json: JSON array of current holdings, e.g. '[{"ticker": "AAPL", "weight": 0.20, "sector": "Technology"}, {"ticker": "MSFT", "weight": 0.15, "sector": "Technology"}, ...]'. candidates: Comma-separated candidate tickers to evaluate (e.g. "META,AVGO,LLY"). style: Investment style -- "garp" (default), "value", "growth", "momentum", "event_driven". overrides_json: Optional JSON of manual score overrides, e.g. '{"AAPL": {"thesis": 75, "catalyst": 60}}'. benchmark: Benchmark ticker (default "SPY"). stages: Comma-separated stages or "all" (default "all"). skip_refresh: Skip data fetching, use cached data (default False). start_date: Price data start date YYYY-MM-DD (default: 3 years ago). end_date: Price data end date YYYY-MM-DD (default: today). source: Data source for price fetching -- "auto" (API first, yfinance fallback), "api", "financial-datasets" (same as "api"), or "yfinance". If empty, reads PORTFOLIO_ROTATION_SOURCE env var (default: "auto").

Returns: JSON with complete pipeline results: scores, swap recommendations, risk analysis, backtest metrics, and markdown report.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portfolio_jsonYes
candidatesYes
styleNogarp
overrides_jsonNo
benchmarkNoSPY
stagesNoall
skip_refreshNo
start_dateNo
end_dateNo
sourceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Despite no annotations, description details the 6 stages and parameter behaviors (e.g., skip_refresh, source fallback). Discloses pipeline flow and data source selection. Lacks mention of potential side effects like API calls or caching, but overall sufficiently transparent for a complex tool.

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?

Description is fairly long but well-structured with bullet points for stages and clear sections for args/returns. All content is relevant and adds value. Slightly verbose for a simple tool, but appropriate for the complexity of a 10-parameter pipeline.

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?

Given 10 parameters, 0% schema coverage, no annotations, but with an output schema (return mentioned), the description covers all parameters, pipeline stages, and return format. Provides sufficient context for an agent to understand input, behavior, and output.

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%, but description provides extensive parameter explanations with examples (portfolio_json format, candidates style, overrides_json structure, env var for source). Adds significant meaning beyond bare schema types and defaults, fully compensating for lack of schema descriptions.

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?

Description clearly states 'Run the full 6-stage rotation analysis pipeline' with specific stages enumerated. Distinguishes from sibling tools (individual stages like analyze_risk, compare_swaps) by positioning itself as the main entry point for a complete analysis.

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?

States 'This is the main entry point for a complete rotation analysis,' implying use when full pipeline is needed. Does not explicitly mention when to use alternatives (individual stages) or exclusions, but context from sibling names makes this clear.

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