Skip to main content
Glama
simoneb

ibkr-risk-mcp

by simoneb

stress_portfolio

Read-onlyIdempotent

Reprice your entire portfolio under simultaneous underlying shocks to reveal the worst-case P&L point and the shock level where it occurs, helping you identify maximum loss scenarios.

Instructions

Reprice the whole portfolio — options, equities, futures — across underlying shocks and return the P&L curve and its trough.

The trough is the primary output: the worst point of the curve and the shock at which it sits. troughRefined interpolates between grid points for where the minimum actually falls, and is labelled as interpolated.

The model, returned with every result in assumptions:

  • all underlyings are shocked by the same percentage at once, which is Risk Navigator's own default assumption. Equity positions can be scaled with betas; options and futures move one-for-one with their underlying.

  • options are repriced with Black-76 on the shocked forward using IB's implied volatility. Equity options are carried from spot using IB's pvDividend, so both kinds go through one pricer.

  • P&L is model-price-now against model-price-shocked, so the curve is exactly zero at zero shock by construction. The gap between the local model and IB's own price is reported per position as modelVsMarket instead of being folded into the curve. Expect it to be small out of the money and a couple of percent in the money, where IB prices the early exercise that Black-76 has no room for — so the curve understates losses slightly once options go deep in the money.

  • bonds are held flat unless bond_rate_shift_bp is set; anything this server does not model is held flat and named in warnings.

Check reconciled before quoting anything. At zero shock the portfolio is rebuilt from its positions and compared against NetLiquidation; a residual over 1% returns reconciled: false with the residual attached. A curve that does not reconcile is missing something, and the number it gives for the trough is missing it too.

Risk Navigator's own volatility shock model is not published. sticky_strike is the approximation that corresponds to its default curve, not a reproduction of it — expect the shape to match and the last few percent not to.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
betasNoPer-symbol beta for equity positions, e.g. {'AAPL': 1.2}. Options and futures always move with their own underlying.
shocksYesUnderlying moves as fractions: -0.10 is a 10% fall. A range like -0.30 to +0.30 in 0.01 steps is the usual ask.
vol_bumpNoAdded to every volatility, in points: 0.05 is +5 points.
vol_modeNosticky_strike keeps each strike's current volatility and is what Risk Navigator's default curve does. sticky_moneyness slides the smile with the forward.sticky_strike
fetch_skewNoLet sticky_moneyness pull neighbouring strikes from IB when the portfolio holds too few to define a smile. Costs extra market data requests.
default_betaNo
date_offset_daysNoRoll the valuation date forward this many days (time decay).
bond_rate_shift_bpNoParallel rate shift in basis points applied to bonds. Zero leaves them unchanged, which is the default.
bond_duration_yearsNoDuration assumed for bonds when a rate shift is applied. IB does not publish duration, so this is your input and the result is only as good as it.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Beyond the readOnlyHint/idempotentHint annotations, the description discloses the Black-76 pricing model, IB volatility handling, modelVsMarket discrepancy, bonds held flat unless shifted, the reconciliation threshold, and the approximation in sticky_strike. This is rich behavioral context that materially helps an agent anticipate results.

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?

The description is long but appropriately sized for a complex tool. It is front-loaded with the main output, then organized into assumptions, reconciliation warnings, and caveats. Each sentence carries unique decision-relevant information without redundant restatement.

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 9 parameters, output schema, and annotations, the description still adds critical context: model assumptions, asset behavior, reconciliation requirements, and known approximation limits. The presence of an output schema means it does not need to enumerate return fields, so the description is complete.

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 high, but the description adds meaningful semantics: betas scale equity positions, bond_rate_shift_bp activates bond repricing, shocks are fractional moves with a typical range, and vol_mode sticky_strike corresponds to Risk Navigator's default behavior. It also explains troughRefined interpolation, which the schema does not.

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 first sentence names a specific action (reprice the whole portfolio), the asset classes involved (options, equities, futures), and the primary output (P&L curve and trough). This clearly differentiates it from sibling stress_whatif, which implies a narrower or different scope.

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?

The description provides clear context: it is for whole-portfolio repricing under underlying shocks, with a reconciliation check before quoting and a typical shock range. It does not explicitly name stress_whatif as the alternative for single-instrument what-if scenarios, so it falls short of full 5-level guidance with explicit when-not-to-use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/simoneb/ibkr-risk-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server