Skip to main content
Glama

optimize_portfolio

Find the optimal portfolio allocation using mean-variance optimization. Supports max Sharpe, min variance, and target return objectives. Paid tier only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tickersYesUniverse of tickers to optimize across. Must be 2-50 tickers. The optimizer will determine the best weights within this set.
objectiveNoOptimization objective. "max_sharpe" = maximize risk-adjusted return, "min_variance" = minimize portfolio volatility, "target_return" = hit a specific return with minimum risk. Default: "max_sharpe".max_sharpe
constraintsNoOptional weight constraints. See ConstraintsInput for details.
lookback_daysNoHistorical window for estimating return and covariance. 252 = 1 year, 756 = 3 years, 1260 = 5 years. Range: 252-1260. Default: 756.
target_returnNoRequired when objective is "target_return". Annualized return as a decimal, e.g. 0.12 = 12% annual return target.
risk_free_rateNoAnnualized risk-free rate as a decimal, e.g. 0.05 = 5%. Used in Sharpe ratio calculation. Default: 0.05.

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden for behavioral transparency. It discloses that the tool is mean-variance optimization and mentions the paid tier restriction, but does not cover error conditions, side effects, or data requirements beyond what is implicit in a read-only computation.

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 two sentences, front-loaded with the core intent, and contains no redundant or extraneous information. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (6 parameters, nested objects, no output schema), the description is brief. It lacks any mention of the output format (e.g., returned weights). While the core functionality is covered, the absence of return value information reduces completeness.

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% (all 6 parameters described in the schema). The description adds little beyond the schema: it lists objectives and mentions constraints, but these are already detailed in the schema. Baseline score of 3 is appropriate.

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 clearly states the tool's purpose: 'Find the optimal portfolio allocation using mean-variance optimization.' It lists supported objectives (max Sharpe, min variance, target return) and distinguishes it from siblings like analyze_risk or compare_portfolios.

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 mentions 'Paid tier only,' indicating a usage restriction, but does not provide explicit guidance on when to use this tool versus alternatives such as monte_carlo_simulation or compare_portfolios. Usage context is implied but not fully specified.

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.

TDQS

A3.7/5.0
Disambiguation5/5

Each tool has a distinct purpose (e.g., risk metrics, Greeks, portfolio optimization, simulation), with no overlap or ambiguity. The descriptions clearly separate core risk analysis from advanced features.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern (e.g., analyze_risk, calculate_greeks), making them predictable and easy to distinguish.

Tool Count5/5

With 10 tools, the server covers a comprehensive range of quantitative risk analytics without being bloated. Each tool serves a clear, non-redundant purpose within risk management.

Completeness4/5

The tool set covers essential risk analysis (VaR, Greeks, optimization, stress tests, attribution) but is missing common features like scenario analysis beyond historical crises or backtesting. Still, it is well above average.