Skip to main content
Glama

AINumbers Fintech Intelligence Suite

On-Chain Repo Haircut Calculator

calculate_repo_haircut
Read-onlyIdempotent

On-Chain Repo Haircut Calculator: OpenChainGraph compute node (collateral_mandate). Deterministic OpenChainGraph compute node. By default (compute:"auto") inputs are computed server-side on Cloudflare Workers for gpu:false nodes with a registered kernel; compute:"browser" forces client-side execution and returns a browser delegation URL instead. gpu:true nodes always delegate to the browser. Inputs are processed transiently to compute the response and are not stored, logged, or retained. Use synthetic or anonymised inputs only. Exports an AP2 artifact with execution_hash for chain provenance. Output feeds: 505-tokenized-collateral-eligibility-checker, 506-onchain-cash-leg-finality-checker. Open at: https://ainumbers.co/tools/508-repo-haircut-collateral-calculator.html FV-status (published/proven/still-trusted for this spec): /fv-status/565f2dd45a55e0ff0f8dafde8c1080f9e1484b32a5aaa96f4d7739a236b9258a.json — a snapshot, not a subscription; this receipt verifies offline regardless of whether that file is ever fetched. Summary: Compute repo haircut, initial margin, and variation margin. Outputs: base_haircut_pct, total_haircut_pct, sft_floor_applied, initial_margin, vm_threshold, canton_haircut_pct, legacy_haircut_pct, weekend_saving_pct, flags. Output schema: call describe_tool("calculate_repo_haircut").

Input Schema

NameRequiredDescriptionDefault
computeNoCompute mode (v0.4 Compute Binding). "auto" (default) = server for gpu:false nodes with registered kernels; "server" = force server-side; "browser" = always return browser delegation URL. gpu:true nodes always delegate.
parent_hashesNoexecution_hash values from upstream ChainGraph AP2 artifacts to chain from (sets chain.parent_hashes in the export).
parent_tool_idsNotool_id values matching parent_hashes, in the same order.
policy_parametersNoInput parameters for this tool's decision function. For gpu:false nodes with a registered kernel, these are computed server-side when compute is "auto" or "server". Required: collateral_type, notional, tenor, counterparty. Unknown keys are refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed3 schema fields changed
    • changedInput schema / properties / policy_parameters / description
      Previous value: -"Input parameters for this tool's decision function. For gpu:false nodes with a registered kernel, these are computed server-side when compute is \"auto\" or \"server\". See the tool's manifest for field names."New value: +"Input parameters for this tool's decision function. For gpu:false nodes with a registered kernel, these are computed server-side when compute is \"auto\" or \"server\". Required: collateral_type, notional, tenor, counterparty. Unknown keys are refused."
    • addedInput schema / properties / policy_parameters / properties
      Added value: +{
      +  "canton_247": {
      +    "type": "boolean"
      +  },
      +  "collateral_type": {
      +    "enum": [
      +      "ust_10y",
      +      "ust_30y",
      +      "agency_mbs",
      +      "ig_corp_bond",
      +      "gilt_10y",
      +      "eu_sovereign"
      +    ],
      +    "type": "string"
      +  },
      +  "concentration_pct": {
      +    "type": "number"
      +  },
      +  "counterparty": {
      +    "enum": [
      +      "dealer_bank",
      +      "buy_side_fund",
      +      "central_bank",
      +      "hedge_fund"
      +    ],
      +    "type": "string"
      +  },
      +  "cross_border": {
      +    "type": "boolean"
      +  },
      +  "currency": {
      +    "enum": [
      +      "USD",
      +      "EUR",
      +      "GBP"
      +    ],
      +    "type": "string"
      +  },
      +  "custodied": {
      +    "type": "boolean"
      +  },
      +  "notional": {
      +    "type": "number"
      +  },
      +  "tenor": {
      +    "enum": [
      +      "overnight",
      +      "1w",
      +      "1m",
      +      "3m",
      +      "6m",
      +      "open_term"
      +    ],
      +    "type": "string"
      +  }
      +}
    • removedInput schema / properties / policy_parameters / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "base_haircut_pct": {
      -      "type": "number"
      -    },
      -    "canton_haircut_pct": {
      -      "type": "number"
      -    },
      -    "flags": {
      -      "type": "array"
      -    },
      -    "initial_margin": {
      -      "type": "number"
      -    },
      -    "legacy_haircut_pct": {
      -      "type": "number"
      -    },
      -    "sft_floor_applied": {
      -      "type": "boolean"
      -    },
      -    "total_haircut_pct": {
      -      "type": "number"
      -    },
      -    "vm_threshold": {
      -      "type": "number"
      -    },
      -    "weekend_saving_pct": {
      -      "type": "number"
      -    }
      -  },
      -  "type": "object"
      -}New value: +null
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "base_haircut_pct": {
      +      "type": "number"
      +    },
      +    "canton_haircut_pct": {
      +      "type": "number"
      +    },
      +    "flags": {
      +      "type": "array"
      +    },
      +    "initial_margin": {
      +      "type": "number"
      +    },
      +    "legacy_haircut_pct": {
      +      "type": "number"
      +    },
      +    "sft_floor_applied": {
      +      "type": "boolean"
      +    },
      +    "total_haircut_pct": {
      +      "type": "number"
      +    },
      +    "vm_threshold": {
      +      "type": "number"
      +    },
      +    "weekend_saving_pct": {
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
  5. Added

TDQS

B3/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, non-open-world. The description meaningfully adds context beyond them: deterministic computation, server-vs-browser execution split, no persistence/logging of inputs, synthetic-input requirement, and emission of an AP2 artifact with execution_hash for provenance. That is substantive behavioural disclosure beyond the structured annotations.

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

Conciseness2/5

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

The description is bloated: a spec-verification URL, a full 64-hex hash path, and an offline-receipt aside precede any statement of what the tool does. The useful summary and output list are buried at the very end, so the definition is neither front-loaded nor efficient.

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 compensates by enumerating output fields (base_haircut_pct, total_haircut_pct, initial_margin, flags, etc.) and covers compute-mode behaviour, chaining parents, privacy, and artifact export. Given the complex nested schema and provenance chaining, this is close to complete, with the main residual gap being no guidance on selecting among sibling haircut tools.

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 every parameter including the nested policy_parameters fields and the compute enum is already documented in the schema. The description restates compute modes and required keys (collateral_type, notional, tenor, counterparty) without adding syntax, ranges, or defaults beyond that, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The actual purpose — 'Compute repo haircut, initial margin, and variation margin' — is a specific verb+resource but appears only in the final 'Summary' sentence, after paragraphs of compute-node boilerplate. It gives no differentiation from closely related siblings such as compute_stock_token_collateral_haircut or compute_basel_haircut_adjusted_exposure, so an agent must infer which haircut calculator to pick.

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

Usage Guidelines2/5

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

The only usage-like text concerns compute modes (auto vs default) and 'use synthetic or synthetic anonymised inputs', not when to select this tool over alternatives. The 'Output feeds' line names downstream tools but gives no condition under which to choose this tool over sibling haircut/valuation tools.

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.