Skip to main content
Glama

ScorpTech x402 Tools

Portfolio Metrics

portfolio_metrics
Read-onlyIdempotent

Portfolio and asset risk/return analytics from price or return series you supply: annualised return (CAGR) and volatility, Sharpe and Sortino ratios, max drawdown, historical and parametric 95% VaR, beta/alpha against a benchmark series and a correlation matrix, for each asset and the weighted (periodically rebalanced) portfolio. Up to 20 assets. POST JSON body. Returns JSON with: periods, periodsPerYear, weights, portfolio, assets, correlation, note. Price: $0.003 USDC per successful call (x402, Base or Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/portfolio-metrics

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "portfolio_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
pricesNoPrice series per asset, oldest first: {"BTC":[...],"ETH":[...]} (same length)
returnsNoAlternatively periodic simple returns per asset as decimals (0.01 = 1%)
weightsNoPortfolio weights per asset (normalised; default equal)
benchmarkNoName of the series to use as benchmark for beta/alpha (excluded from the portfolio unless weighted)
riskFreePctNoAnnual risk-free rate in percent
periodsPerYearNo252 trading days, 365 crypto days, 52 weeks, 12 months

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-destructive and open-world, and the description goes well beyond that: per-call pricing ($0.003 USDC via x402 on Base or Solana), a 20-asset ceiling, the POST JSON transport, the periodically-rebalanced weighting assumption, and the exact response keys. That is exactly the context annotations cannot carry.

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 metric list, input contract, limits, response keys, price and alternate endpoint are all packed into a front-loaded block with no filler sentences. It is dense rather than bloated, though the metric enumeration is long enough that a reader must parse carefully.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description compensates by naming the returned fields (periods, periodsPerYear, weights, portfolio, assets, correlation, note). Combined with cost, transport and size limits, nothing material is left for the agent to guess before calling.

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 coverage is 100%, so the baseline would be 3; the description earns above that by adding a hard constraint absent from the schema — the 20-asset cap on the prices/returns maps — and by framing prices and returns as mutually exclusive inputs. It still does not explain weight normalisation or benchmark interaction beyond what the schema already states.

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 opens with a specific verb-and-resource framing ('Portfolio and asset risk/return analytics from price or return series you supply') and then enumerates the exact metrics computed (CAGR, volatility, Sharpe, Sortino, max drawdown, VaR, beta/alpha, correlation). An agent knows precisely what it gets back without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly establishes the input contract — supply either a price series or a return series, up to 20 assets, via a POST JSON body — which tells the agent when this tool applies. It does not name an alternative or state when not to use it, but the sibling set is unrelated arithmetic utilities, so the missing exclusion costs little.

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