Skip to main content
Glama

BRAINIAC Portfolio Analytics

Markowitz mean-variance optimisation

portfolio-analytics_mean-variance-optimize
Read-onlyIdempotent

Minimum variance, target return, max Sharpe or target volatility portfolios from expected returns and a covariance matrix, with bounds. Price $0.05 USDC. POST /api/v1/portfolio-analytics/mean-variance-optimize. An unpaid call returns the x402 payment terms and does not run.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "assets": "<assets>",
      "expectedReturns": "<expectedReturns>",
      "objective": "<objective>"
    },
    "name": "portfolio-analytics_mean-variance-optimize"
  }
}

Input Schema

NameRequiredDescriptionDefault
assetsYesassets, array. Required.
boundsNobounds, object. Required.
groupsNogroups, array. Required.
returnsNoreturns, array. Optional.
riskFreeNoriskFree, number. Required.
objectiveYesobjective, string, one of min_variance, target_return, max_sharpe, target_volatility. Required.
shrinkageNoshrinkage, string, one of none, ledoit_wolf. Required.none
covarianceNocovariance, array. Optional.
targetReturnNotargetReturn, number. Optional.
frontierPointsNofrontierPoints, integer, from 0 to 100. Required.
expectedReturnsYesexpectedReturns, array. Required.
targetVolatilityNotargetVolatility, number. Optional.

Output Schema

NameRequiredDescriptionDefault
sharpeNosharpe. Number.
statusNostatus. String.
sourcesNosources. Array.
weightsNoweights. Array.
volatilityNovolatility. Number.
limitationsNolimitations. Array.
expectedReturnNoexpectedReturn. Number.
activeConstraintsNoactiveConstraints. Array.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior5/5

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

Annotations already declare a safe read operation (readOnlyHint=true, destructiveHint=false), so the bar is lower, and the description still adds non-obvious behavior the annotations cannot express: a price of $0.05 USDC, the HTTP endpoint, and the fact that an unpaid call returns x402 payment terms without executing. That payment-gating disclosure is exactly the kind of pre-call detail an agent needs.

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?

Three short sentences, front-loaded with what the tool computes, followed by cost/endpoint and the failure mode of an unpaid call. No filler sentences, and each one carries information an agent can act on.

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?

For a 12-parameter tool with nested objects, enums, and an existing output schema, the description correctly leaves return-value explanation to the schema and optional inputs to the field docs. It covers the distinguishing inputs and the payment prerequisite; only the optional path (returns/shrinkage-based estimation instead of an explicit covariance) goes unmentioned.

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 description coverage is 100%, so every parameter is already documented structurally. The description restates the two main inputs and mentions bounds but adds no format, dimensionality, or constraint detail (e.g. covariance must align with expectedReturns, asset ordering) beyond what the schema supplies, so baseline 3 applies.

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 names a concrete verb and resource ('minimum variance, target return, max Sharpe or target volatility portfolios from expected returns and a covariance matrix') and enumerates the four objective modes an agent must choose from. It does not name a sibling to contrast with (e.g. risk-parity-weights), but the portfolio-optimization framing is specific enough to separate it from typical analytics siblings.

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?

Usage context is implied: this is the tool for constrained mean-variance construction from expected returns and covariance. There is no explicit when-to-use versus alternatives such as risk-parity-weights or risk-metrics, so an agent must infer the split from the tool name alone.

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.

Resources