Skip to main content
Glama

risk_set

Set the run: how many trials (default 2000), the seed, which nodes a simulation reports in full (outputs, by name — the lines the risk is about), and statistics: named formulas whose outermost call reduces over trials — PROBABILITY(condition), EXPECTED(value), STDEV(value), PERCENTILE(value, level) or TAILMEAN(value, level), each with an optional condition as the last argument — e.g. PROBABILITY(bs.equity < 0), PERCENTILE(income.profit, 5%) for a 5% value at risk, TAILMEAN(income.profit, 5%) for the expected shortfall beyond it, EXPECTED(cash, copper.price < 7000) for a conditional mean (the level is a share: 5% or 0.05). copula: how correlated draws are joined — gaussian (the default) has no tail dependence, so correlated assumptions stop moving together in the extremes; {family: t, df: 3–6} makes the extremes arrive together, which is what a stress model means; tail lower joins only the low draws (crashes together, booms as independent as the Gaussian's) and upper only the high ones. sampling: random (default), latin (a Latin hypercube — the same answer with far less sampling noise for the same trials; the usual choice for a model quoted to a committee) or antithetic. rename_statistics renames a statistic and every card, document and sentence that names it ({{p_loss}} in prose, a risk block's list) — never rename one by removing it from statistics and adding it under the new name, which leaves those naming nothing. Only the fields you pass change; an empty list clears one.

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": {
      "model": "<model>"
    },
    "name": "risk_set"
  }
}

Input Schema

NameRequiredDescriptionDefault
seedNo
modelYesModel uid (`model_…`), from model_list.
copulaNo
trialsNo
outputsNo
samplingNo
statisticsNo
rename_statisticsNoStatistics to rename, applied before `statistics` (which then names them by their new names).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only say it's a non-read-only, non-destructive, non-idempotent write. The description adds real behavioral context the annotations lack: only passed fields change, an empty list clears a field, and rename_statistics rewrites every card, document and prose reference, with a warning that the naive alternative leaves dangling references. It doesn't cover failure modes, permissions, or what happens to statistics omitted from a later call.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with the main settings, but the entire definition is one dense run-on paragraph, and the highest-value material — the formula grammar and the rename caveat — is buried mid-stream. Little is wasted semantically, but scannability suffers badly for an 8-parameter tool.

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 an 8-parameter, nested-object write tool with no output schema and thin schema descriptions, the definition covers nearly everything an agent needs: defaults, enum meanings, formula syntax, update semantics, and rename ordering relative to statistics. Only seed (trivial) and model (covered by the schema) go unaddressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 25% across 8 parameters, yet the description supplies defaults (trials 2000, gaussian, random), the meaning of each sampling and copula option, tail lower/upper semantics, and a full grammar for the statistics formula string with worked examples. That is substantially more than the schema conveys and compensates for the coverage gap.

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 the concrete configuration surface it writes — trials, seed, outputs, statistics, copula, sampling, renames — so an agent knows exactly what class of operation this is. It doesn't explicitly contrast itself with risk_run or risk_get, so sibling differentiation rests on the reader inferring that this configures rather than executes or reads.

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?

Strong parameter-level guidance: latin is named the usual choice for committee-facing models, gaussian is flagged as having no tail dependence, and {family: t, df: 3–6} is recommended for stress models. It also states an explicit prohibition (never rename by removing and re-adding a statistic). What's missing is tool-level guidance on when to call risk_set versus risk_run or risk_get.

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