Skip to main content
Glama

AlgoVesta MCP Trading

simulate_policy

Read-onlyIdempotent

Answers "if I had had this risk rule in place, which of my trades would it have blocked, and what would that have done to my PnL?".

It takes a risk policy - written in plain English, passed in already compiled, or
your currently active one - and applies it to the trades YOU actually closed. It
reports which ones would have been rejected, by which rule, and the PnL difference.

Runs in the background: the call returns a `job_ref`, and `get_job_status(job_ref)`
returns the result.

Two honesty limits are always reported in `assumptions`:
- Rules that depend on account state at the moment of the order (open position count,
  daily loss so far, balance) are evaluated with zeros, because that state cannot be
  reconstructed from closed trades. Those rules are UNDER-counted, never over-counted.
- PnL comes from your recorded realised results; it is not re-simulated. If your
  trades settled in more than one currency, totals are reported per currency and are
  NOT added together.

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": "simulate_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoHow far back to look, in days (1-365). Only trades you actually CLOSED in this window are evaluated.
rulesNoAn already-compiled rules object (the output of compile_policy). Use this instead of policy_text when you want to test an exact rule set.
policy_textNoThe risk policy in plain English, e.g. 'never trade DOGE, never use more than 10x, always require a stop-loss'. Leave empty to test the policy you already have active.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description goes well beyond them: it discloses the background-execution model (job_ref plus get_job_status polling) and, unusually, two explicit honesty limits — state-dependent rules evaluated with zeros so they are under-counted, and PnL taken from recorded realised results rather than re-simulated, with multi-currency totals reported per currency and deliberately not summed. These are exactly the caveats an agent needs to interpret results correctly and would be invisible from structured fields alone.

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?

Front-loaded with the question the tool answers, then inputs, then execution model, then caveats — a logical order with no filler sentences. The bulleted assumptions block is well-structured for scanning. It is somewhat long, and the opening question could be tightened, but nearly every clause carries information an agent needs.

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?

With no output schema, the description still covers the return path (job_ref, then results via get_job_status) and the assumptions field, and it pre-empts the most likely misreading of results. It does not describe the shape of the per-trade rejection report or PnL-diff payload, leaving some structure to discovery, but for a read-only simulation tool with full schema coverage the definition is substantially complete.

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 the schema already explains days (1-365, closed trades only), rules (compiled output of compile_policy), and policy_text (plain English, empty to use active policy). The description reinforces the policy_text-vs-rules choice and gives an example policy string, but adds no syntax or format detail beyond what the schema states, and never mentions the days window. Baseline 3 is appropriate when the schema carries the parameter load.

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?

Opens with a concrete, human-phrased statement of exactly what it computes ('which of my trades would it have blocked, and what would that have done to my PnL') and then names the verb+resource: applies a risk policy to your closed trades and reports rejections, triggering rule, and PnL delta. It distinguishes itself from compile_policy (which produces the rules object it consumes) and from get_job_status (which retrieves the result), so an agent can place it without opening a 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?

Gives clear routing logic for the three input modes: plain-English policy, an already-compiled rule set ('use this instead of policy_text when you want to test an exact rule set'), or empty to test the currently active policy. It also states the async contract — the call returns a job_ref and must be polled via get_job_status(job_ref). It stops short of explicitly excluding overlapping siblings such as backtest_my_signals or simulate_order, so it is strong but not a full when/when-not statement.

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.