Skip to main content
Glama

TradingCalc MCP: Options, Forex, Risk Stats, Prediction Markets, On-Chain & Crypto Futures

Barrier Touch

workflow.run_barrier_touch
Read-only

Probability that the price touches a barrier (a target or a stop level) at ANY time within N days, under geometric Brownian motion (reflection principle with drift). This is not the probability of finishing beyond the level at expiry: at zero log-drift a touch is exactly twice as likely as a finish, and finishBeyondProbabilityPct is returned next to it for comparison (the end-of-window question itself is workflow.run_window_fair_value). Barrier above spot gives an up-touch, below spot a down-touch. Monitoring is continuous (every instant, not daily closes or candle highs, which touch less often); year is 365 days; driftPct is the annualized expected price drift, default 0. Output: touchProbabilityPct, finishBeyondProbabilityPct, direction, barrierDistancePct. Edge cases: spot, barrier and daysToExpiry (at most 3650) above zero; volatilityPct 0.01 to 1000; driftPct -1000 to 1000; barrier and spot must be within a factor of about 5e8 of each other. Not covered: a discrete-monitored barrier, knock-in or knock-out option prices, jumps, volatility that changes over time, trading costs; the probability is under a constant volatility and drift.

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": {
      "spot": "<spot>",
      "barrier": "<barrier>",
      "daysToExpiry": "<daysToExpiry>",
      "volatilityPct": "<volatilityPct>"
    },
    "name": "workflow.run_barrier_touch"
  }
}

Input Schema

NameRequiredDescriptionDefault
spotYesCurrent price, USD (any quote currency)
barrierYesThe level to touch, same units as spot. Above spot: up-touch; below spot: down-touch
driftPctNoAnnualized expected price drift in percentage points. Default 0.
daysToExpiryYesCalendar days in the window (can be fractional, up to 3650)
volatilityPctYesAnnualized volatility in percentage points (e.g. 60 for 60%), at least 0.01

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, but the description adds substantial context beyond them: the model (geometric Brownian motion, reflection principle with drift), the assumption of constant volatility and drift, continuous rather than discrete monitoring, the 365-day year convention, and an explicit 'not covered' list (discrete barriers, knock-in/knock-out pricing, jumps, time-varying vol, trading costs). That is exactly the model-risk disclosure an agent needs to caveat its answer.

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 core definition and the key contrast to the finish-beyond probability before edge cases; every sentence carries information. It is dense and parenthetical-heavy in places, which slightly reduces scannability, but there is no filler.

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?

Although there is no output schema, the description enumerates the returned fields (touchProbabilityPct, finishBeyondProbabilityPct, direction, barrierDistancePct), states valid input ranges, and lists model limitations. For a five-parameter analytic calculator, nothing an agent needs to call it or interpret the result is missing.

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 schema already documents all five parameters; the description still adds meaning by clarifying that driftPct is annualized and defaults to 0, that monitoring is continuous so daysToExpiry is a calendar-day window capped at 3650, and by restating the valid numeric ranges for volatilityPct and driftPct. It goes beyond the schema baseline but does not add per-parameter usage nuance beyond what is already structured.

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?

States a specific verb and resource — the probability that price touches a barrier at any time within N days — and immediately distinguishes it from the related but different 'finish beyond the level' question, naming the sibling tool (workflow.run_window_fair_value) that answers that one. An agent can select this tool without opening any schema.

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

Usage Guidelines5/5

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

Explicitly says when this tool is the right one (any-time touch within a window, continuous monitoring) and when it is not (end-of-window probability → workflow.run_window_fair_value). It also states direction semantics (barrier above spot = up-touch, below = down-touch) so the agent knows which question it is answering.

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.