Skip to main content
Glama

get_efficient_frontier

Calculate optimal portfolio combinations by generating efficient frontier data points that show the highest expected return for each risk level.

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

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