Skip to main content
Glama

optimize_portfolio

Compute optimal asset allocation for a stock portfolio using mean-variance optimization. Methods include maximizing Sharpe ratio, minimizing variance, risk budgeting, and Black-Litterman.

Instructions

Optimize portfolio weights using mean-variance optimization.

Args: universe: List of tickers (e.g. ["AAPL", "MSFT", "GOOGL", "TSLA"]) method: "max_sharpe", "min_variance", "risk_budget", or "black_litterman" period_start: Start date YYYY-MM-DD period_end: End date YYYY-MM-DD long_only: Only allow long positions (default: true)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
universeYes
methodNomax_sharpe
period_startNo
period_endNo
long_onlyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It only states that it uses mean-variance optimization, but does not disclose any behavioral traits such as data source, constraints, assumptions, or side effects. For a financial optimization tool, this is insufficient.

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. It starts with a clear purpose sentence, followed by a docstring-style parameter list. No redundant words or sentences.

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 5 parameters, 0% schema coverage, and no annotations, the description covers the purpose and parameter semantics minimally but lacks context on the optimization methodology, data requirements, or output interpretation. The presence of an output schema reduces the burden for return values, but overall completeness is adequate for basic use.

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?

Schema description coverage is 0%, so the description must compensate. It adds meaning by describing each parameter: universe as list of tickers, method with enum-like values, dates in YYYY-MM-DD format, long_only default true. However, it does not explain the optimization methods or exact date format details.

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: 'Optimize portfolio weights using mean-variance optimization.' It includes a specific verb ('optimize') and resource ('portfolio weights'), and the list of parameters provides context. There are no sibling tools with similar names, so differentiation is not an issue.

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 does not provide any guidance on when to use this tool versus alternatives. Sibling tools like 'backtest' and 'get_model_recommendation' are related but not compared. The usage context is implied but no explicit when-to-use or when-not-to-use 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/beee003/vynn-mcp'

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