Skip to main content
Glama
l4b4r4b4b4
by l4b4r4b4b4

get_efficient_frontier

Generate efficient frontier points to visualize optimal portfolios with the best risk-return trade-offs for a given set of assets.

Instructions

Generate efficient frontier data points for visualization.

    Calculates points along the efficient frontier, which represents
    the set of optimal portfolios offering the highest expected return
    for a given level of risk.

    Args:
        name: The portfolio name.
        num_points: Number of points to generate along the frontier.

    Returns:
        Dictionary containing:
        - frontier_points: List of {volatility, expected_return} points
        - optimal_sharpe: Maximum Sharpe ratio portfolio
        - optimal_min_volatility: Minimum volatility portfolio
        - individual_stocks: Individual stock positions
        - current_portfolio: Current portfolio position

    Example:
        ```
        result = get_efficient_frontier(name="tech_stocks", num_points=100)

        # Plot the frontier
        for point in result['frontier_points']:
            print(f"Vol: {point['volatility']:.2%}, Return: {point['expected_return']:.2%}")
        ```
    

Caching Behavior:

  • Any input parameter can accept a ref_id from a previous tool call

  • Large results return ref_id + preview; use get_cached_result to paginate

  • All responses include ref_id for future reference

Preview Size: server default. Override per-call with get_cached_result(ref_id, max_size=...).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
num_pointsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It mentions caching behavior and preview size, which are helpful, but it does not explicitly state whether the tool is read-only or if it has side effects. Given the 'get' in the name, safety is implied but not confirmed, and no permissions or limitations are described.

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?

The description is well-structured with clear sections for Args, Returns, Example, and caching behavior. The example is useful. However, the inclusion of generic caching boilerplate that applies to all tools on the server adds unnecessary length. Overall, it is informative without being overly verbose.

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?

Given the complexity and the presence of many related sibling tools, the description covers the main aspects: purpose, parameters, return structure, and an example. It does not explicitly differentiate from siblings, but the return structure and visualization focus provide sufficient context. The caching behavior also adds completeness for large datasets.

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 input schema has 0% description coverage, so the description compensates well by explaining both parameters: 'name' as the portfolio name and 'num_points' as the number of points. This adds significant value beyond the raw schema, which only specifies types and defaults. However, it does not provide examples of valid values or constraints.

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 purpose as generating efficient frontier data points for visualization. The verb 'generate' combined with the specific resource 'efficient frontier' makes the function clear. However, it does not explicitly distinguish this tool from siblings like 'optimize_portfolio' or 'run_monte_carlo', though the visualization focus is implied.

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 some context by mentioning 'for visualization', but it lacks explicit guidance on when to use this tool versus alternatives. No exclusions or specific conditions are stated. The agent must infer usage from the general context of portfolio optimization tools.

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/l4b4r4b4b4/portfolio-mcp'

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