Skip to main content
Glama

Constrained Optimization MCP Server

solve_portfolio_optimization

Optimize asset allocation to maximize returns while controlling risk using mean-variance analysis with customizable constraints.

Instructions

Solve portfolio optimization problems using modern portfolio theory. This tool implements Markowitz mean-variance optimization to find optimal asset allocations that maximize expected return while constraining risk. Args: assets: List of asset names expected_returns: List of expected returns for each asset risk_factors: List of risk factors (standard deviations) for each asset correlation_matrix: Correlation matrix between assets max_allocations: Optional maximum allocation limits for each asset risk_budget: Optional maximum portfolio risk (variance) description: Optional problem description Returns: Optimal portfolio weights and performance metrics Example: assets = ["Bonds", "Stocks", "RealEstate", "Commodities"] expected_returns = [0.08, 0.12, 0.10, 0.15] risk_factors = [0.02, 0.15, 0.08, 0.20] correlation_matrix = [[1.0, 0.2, 0.3, 0.1], [0.2, 1.0, 0.6, 0.7], ...] max_allocations = [0.4, 0.6, 0.3, 0.2] risk_budget = 0.01

Input Schema

NameRequiredDescriptionDefault
assetsYes
correlation_matrixYes
descriptionNo
expected_returnsYes
max_allocationsNo
risk_budgetNo
risk_factorsYes

Input Schema (JSON Schema)

{ "properties": { "assets": { "items": { "type": "string" }, "title": "Assets", "type": "array" }, "correlation_matrix": { "items": { "items": { "type": "number" }, "type": "array" }, "title": "Correlation Matrix", "type": "array" }, "description": { "default": "", "title": "Description", "type": "string" }, "expected_returns": { "items": { "type": "number" }, "title": "Expected Returns", "type": "array" }, "max_allocations": { "default": null, "items": { "type": "number" }, "title": "Max Allocations", "type": "array" }, "risk_budget": { "default": null, "title": "Risk Budget", "type": "number" }, "risk_factors": { "items": { "type": "number" }, "title": "Risk Factors", "type": "array" } }, "required": [ "assets", "expected_returns", "risk_factors", "correlation_matrix" ], "type": "object" }

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/Sharmarajnish/MCP-Constrained-Optimization'

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