Skip to main content
Glama

agent_begin_trade

Obtain oracle assessment evidence for a swap/DeFi intent BEFORE trading. Insight runs the oracle safety check and, if the verdict is PASS/CAUTION, returns a machine-readable "execution certification handle": preTradeUid, requestHash, CAIP-19 asset ids, the certified price (destination per source) and maxSlippageBps, plus a required operation-input check for both asset legs and a fresh Uniswap V3 on-chain route quote cross-checked by two Ethereum RPCs. If either input assessment is not SUFFICIENT, either route quote is stale or outside policy, or either oracle gate blocks, no execution handle is issued. The assessments are independently EIP-712 signed and linked to the receipt through both pre-trade UIDs. participant/source-group counts and the pre-trade signing time. Execute the trade with YOUR wallet, then call execution_receipt with this handle + txHash to obtain the signed, verifiable Execution Receipt. If the verdict is DANGER or BLOCK this tool refuses (do not trade). This is oracle assessment evidence, not principal authorization — pair it with execution_receipt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetYesSource asset symbol being sold, e.g. ETH, USDC
actionYes
chainIdYesChain ID where the trade executes, e.g. 1=Ethereum, 42161=Arbitrum, 8453=Base
protocolIdNoOptional lending protocol id (lending actions only)
decisionInputYesRequired operation-input gate for both assets and the caller-reported route quote. Insight also obtains an exact-notional Uniswap V3 quote on Ethereum mainnet, sized from a fresh Chainlink price and cross-checked by two RPCs at one block. No execution handle is issued unless both signed assessments pass and the on-chain quote, caller quote, and oracle cross-rate satisfy the 50 bps-capped policy. Supported pairs are ETH/WETH, USDC, and WBTC on Ethereum; other routes fail closed.
maxSlippageBpsYesCurrent pre-committed execution tolerance; custom values are rejected
tradeAmountUsdYesTrade size in USD
targetProvidersNoOptional: restrict the check to specific oracle providers
destinationAssetYesDestination asset symbol being bought, e.g. USDC, ETH
sourceGroupCountNoDistinct non-derived operator groups; defaults to participantCount

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / decisionInput / properties / destination / properties / quoteProvenance
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "asset": {
      +      "pattern": "^[A-Za-z0-9_.:-]{1,80}$",
      +      "type": "string"
      +    },
      +    "captureMethod": {
      +      "enum": [
      +        "client-held",
      +        "onchain-read"
      +      ],
      +      "type": "string"
      +    },
      +    "chainId": {
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "observedAt": {
      +      "format": "date-time",
      +      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
      +      "type": "string"
      +    },
      +    "quotePriceUsd": {
      +      "exclusiveMinimum": 0,
      +      "type": "number"
      +    },
      +    "requestHash": {
      +      "pattern": "^0x[0-9a-fA-F]{64}$",
      +      "type": "string"
      +    },
      +    "responseHash": {
      +      "pattern": "^0x[0-9a-fA-F]{64}$",
      +      "type": "string"
      +    },
      +    "rightsScope": {
      +      "enum": [
      +        "synthetic",
      +        "onchain",
      +        "customer-authorized",
      +        "vendor-licensed",
      +        "research-quarantined"
      +      ],
      +      "type": "string"
      +    },
      +    "schemaVersion": {
      +      "const": 1,
      +      "type": "number"
      +    },
      +    "sourceId": {
      +      "pattern": "^[A-Za-z0-9_.:-]{1,160}$",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "schemaVersion",
      +    "sourceId",
      +    "rightsScope",
      +    "captureMethod",
      +    "asset",
      +    "chainId",
      +    "quotePriceUsd",
      +    "observedAt",
      +    "requestHash",
      +    "responseHash"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / properties / decisionInput / properties / destination / required
      Previous value: -[
      -  "decisionPriceUsd",
      -  "quotePriceUsd",
      -  "quoteObservedAt",
      -  "maxReferenceDeviationBps",
      -  "maxSlippageBps",
      -  "maxQuoteAgeSeconds"
      -]New value: +[
      +  "decisionPriceUsd",
      +  "quotePriceUsd",
      +  "quoteObservedAt",
      +  "maxReferenceDeviationBps",
      +  "maxSlippageBps",
      +  "maxQuoteAgeSeconds",
      +  "quoteProvenance"
      +]
    • addedInput schema / properties / decisionInput / properties / source / properties / quoteProvenance
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "asset": {
      +      "pattern": "^[A-Za-z0-9_.:-]{1,80}$",
      +      "type": "string"
      +    },
      +    "captureMethod": {
      +      "enum": [
      +        "client-held",
      +        "onchain-read"
      +      ],
      +      "type": "string"
      +    },
      +    "chainId": {
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "observedAt": {
      +      "format": "date-time",
      +      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
      +      "type": "string"
      +    },
      +    "quotePriceUsd": {
      +      "exclusiveMinimum": 0,
      +      "type": "number"
      +    },
      +    "requestHash": {
      +      "pattern": "^0x[0-9a-fA-F]{64}$",
      +      "type": "string"
      +    },
      +    "responseHash": {
      +      "pattern": "^0x[0-9a-fA-F]{64}$",
      +      "type": "string"
      +    },
      +    "rightsScope": {
      +      "enum": [
      +        "synthetic",
      +        "onchain",
      +        "customer-authorized",
      +        "vendor-licensed",
      +        "research-quarantined"
      +      ],
      +      "type": "string"
      +    },
      +    "schemaVersion": {
      +      "const": 1,
      +      "type": "number"
      +    },
      +    "sourceId": {
      +      "pattern": "^[A-Za-z0-9_.:-]{1,160}$",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "schemaVersion",
      +    "sourceId",
      +    "rightsScope",
      +    "captureMethod",
      +    "asset",
      +    "chainId",
      +    "quotePriceUsd",
      +    "observedAt",
      +    "requestHash",
      +    "responseHash"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / properties / decisionInput / properties / source / required
      Previous value: -[
      -  "decisionPriceUsd",
      -  "quotePriceUsd",
      -  "quoteObservedAt",
      -  "maxReferenceDeviationBps",
      -  "maxSlippageBps",
      -  "maxQuoteAgeSeconds"
      -]New value: +[
      +  "decisionPriceUsd",
      +  "quotePriceUsd",
      +  "quoteObservedAt",
      +  "maxReferenceDeviationBps",
      +  "maxSlippageBps",
      +  "maxQuoteAgeSeconds",
      +  "quoteProvenance"
      +]
  2. Changed3 schema fields changed
    • changedInput schema / properties / decisionInput / description
      Previous value: -"Required operation-input gate for both assets and the route quote; no execution handle is issued unless both evidence assessments pass and the route quote is fresh and within the reference policy."New value: +"Required operation-input gate for both assets and the caller-reported route quote. Insight also obtains an exact-notional Uniswap V3 quote on Ethereum mainnet, sized from a fresh Chainlink price and cross-checked by two RPCs at one block. No execution handle is issued unless both signed assessments pass and the on-chain quote, caller quote, and oracle cross-rate satisfy the 50 bps-capped policy. Supported pairs are ETH/WETH, USDC, and WBTC on Ethereum; other routes fail closed."
    • addedInput schema / properties / decisionInput / properties / routeQuoteObservedAt / description
      Added value: +"Timezone-qualified caller quote timestamp; checked for freshness as an additional condition"
    • addedInput schema / properties / decisionInput / properties / routeQuotePrice / description
      Added value: +"Caller-reported destination-per-source route quote, compared with Insight's on-chain quote"
  3. Changed2 schema fields changed
    • addedInput schema / properties / decisionInput
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Required operation-input gate for both assets and the route quote; no execution handle is issued unless both evidence assessments pass and the route quote is fresh and within the reference policy.",
      +  "properties": {
      +    "destination": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "decisionPriceUsd": {
      +          "exclusiveMinimum": 0,
      +          "type": "number"
      +        },
      +        "maxQuoteAgeSeconds": {
      +          "maximum": 300,
      +          "minimum": 1,
      +          "type": "integer"
      +        },
      +        "maxReferenceDeviationBps": {
      +          "maximum": 10000,
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "maxSlippageBps": {
      +          "maximum": 50,
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "quoteObservedAt": {
      +          "format": "date-time",
      +          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
      +          "type": "string"
      +        },
      +        "quotePriceUsd": {
      +          "exclusiveMinimum": 0,
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "decisionPriceUsd",
      +        "quotePriceUsd",
      +        "quoteObservedAt",
      +        "maxReferenceDeviationBps",
      +        "maxSlippageBps",
      +        "maxQuoteAgeSeconds"
      +      ],
      +      "type": "object"
      +    },
      +    "routeQuoteObservedAt": {
      +      "format": "date-time",
      +      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
      +      "type": "string"
      +    },
      +    "routeQuotePrice": {
      +      "exclusiveMinimum": 0,
      +      "type": "number"
      +    },
      +    "source": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "decisionPriceUsd": {
      +          "exclusiveMinimum": 0,
      +          "type": "number"
      +        },
      +        "maxQuoteAgeSeconds": {
      +          "maximum": 300,
      +          "minimum": 1,
      +          "type": "integer"
      +        },
      +        "maxReferenceDeviationBps": {
      +          "maximum": 10000,
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "maxSlippageBps": {
      +          "maximum": 50,
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        "quoteObservedAt": {
      +          "format": "date-time",
      +          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
      +          "type": "string"
      +        },
      +        "quotePriceUsd": {
      +          "exclusiveMinimum": 0,
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "decisionPriceUsd",
      +        "quotePriceUsd",
      +        "quoteObservedAt",
      +        "maxReferenceDeviationBps",
      +        "maxSlippageBps",
      +        "maxQuoteAgeSeconds"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "source",
      +    "destination",
      +    "routeQuotePrice",
      +    "routeQuoteObservedAt"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "asset",
      -  "destinationAsset",
      -  "chainId",
      -  "action",
      -  "tradeAmountUsd",
      -  "maxSlippageBps"
      -]New value: +[
      +  "asset",
      +  "destinationAsset",
      +  "chainId",
      +  "action",
      +  "tradeAmountUsd",
      +  "maxSlippageBps",
      +  "decisionInput"
      +]
  4. First observed

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does so well: it discloses refuse-on-DANGER/BLOCK semantics, the all-or-nothing handle issuance condition, the fixed 50 bps cap, EIP-712 signed assessments, dual-RPC cross-checking, fail-closed unsupported pairs, and that it is evidence not principal authorization. Auth/rate-limit behavior is not addressed, keeping it below 5.

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?

The purpose and failure conditions are front-loaded, but the middle degrades into a garbled fragment ('participant/source-group counts and the pre-trade signing time.') with no subject, and several clauses are dense and repetitive. Length is defensible for the tool's complexity, but the structure could be tightened.

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 a 10-parameter, deeply nested, no-annotation, no-output-schema tool, the description covers the workflow, refusal/failure modes, signing model, and the follow-up call to execution_receipt. It is nearly complete; remaining gaps are auth/rate-limit behavior and explicit routing versus the similarly named pre_trade_safety_check sibling.

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 already 90%, so baseline 3, but the description adds real meaning: the decisionInput gate is described as a required operation-input check for both legs plus an exact-notional Uniswap V3 quote cross-checked by two RPCs, and it explains the maxSlippageBps=50 pre-committed tolerance policy. This clarifies intent beyond the schema's field-level text.

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+resource ('Obtain oracle assessment evidence for a swap/DeFi intent BEFORE trading') and enumerates the concrete artifacts returned (preTradeUid, requestHash, CAIP-19 asset ids, certified price, maxSlippageBps). It distinguishes itself from sibling execution_receipt by positioning the handle as pre-execution evidence and execution_receipt as the post-execution verifiable receipt.

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 sequencing: call this BEFORE trading, execute with your own wallet, then call execution_receipt with the handle + txHash. It also states the refusal condition ('If the verdict is DANGER or BLOCK this tool refuses (do not trade)'). It falls short of explicitly contrasting with the sibling pre_trade_safety_check, leaving the agent to infer which gate to use.

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