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

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. Changed1 schema field changed
    • changedInput schema / properties / targetProviders / items / enum
      Previous value: -[
      -  "chainlink",
      -  "pyth",
      -  "stork",
      -  "api3",
      -  "redstone",
      -  "dia",
      -  "winklink",
      -  "supra",
      -  "twap",
      -  "reflector",
      -  "flare",
      -  "band"
      -]New value: +[
      +  "chainlink",
      +  "pyth",
      +  "stork",
      +  "chronicle",
      +  "api3",
      +  "redstone",
      +  "dia",
      +  "winklink",
      +  "supra",
      +  "twap",
      +  "reflector",
      +  "flare",
      +  "band"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / targetProviders / items / enum
      Previous value: -[
      -  "chainlink",
      -  "pyth",
      -  "api3",
      -  "redstone",
      -  "dia",
      -  "winklink",
      -  "supra",
      -  "twap",
      -  "reflector",
      -  "flare",
      -  "band"
      -]New value: +[
      +  "chainlink",
      +  "pyth",
      +  "stork",
      +  "api3",
      +  "redstone",
      +  "dia",
      +  "winklink",
      +  "supra",
      +  "twap",
      +  "reflector",
      +  "flare",
      +  "band"
      +]
  3. Changed1 schema field changed
    • changedInput schema / properties / targetProviders / items / enum
      Previous value: -[
      -  "chainlink",
      -  "api3",
      -  "redstone",
      -  "dia",
      -  "winklink",
      -  "supra",
      -  "twap",
      -  "reflector",
      -  "flare",
      -  "band"
      -]New value: +[
      +  "chainlink",
      +  "pyth",
      +  "api3",
      +  "redstone",
      +  "dia",
      +  "winklink",
      +  "supra",
      +  "twap",
      +  "reflector",
      +  "flare",
      +  "band"
      +]
  4. 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"
      +]
  5. Changed2 schema fields changed
    • addedInput schema / properties / decisionInput
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "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.",
      +  "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": {
      +      "description": "Timezone-qualified caller quote timestamp; checked for freshness as an additional condition",
      +      "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": {
      +      "description": "Caller-reported destination-per-source route quote, compared with Insight's on-chain quote",
      +      "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"
      +]
  6. First observed

TDQS

A3.9/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden, and it does substantial work: it enumerates every fail-closed condition (either input assessment not SUFFICIENT, stale/out-of-policy route quote, blocked oracle gate) and states no handle is issued. It also discloses signing (EIP-712), the dual-RPC cross-check, and that this is evidence rather than principal authorization. It omits auth/permission requirements and latency expectations.

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 is front-loaded in the first sentence, but the body is a very dense run-on that crams signing, UIDs, and route-quote mechanics together. One sentence is an orphaned fragment ('participant/source-group counts and the pre-trade signing time.') that dangles without a subject, and the closing 'not principal authorization' point partly repeats the earlier framing.

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 nested-schema tool with no output schema and no annotations, the description is unusually complete: it describes what the returned handle contains, what conditions suppress it, and how it links to execution_receipt. The broken fragment about participant counts and signing time is the one place where a promised detail is left unreadable.

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?

With 90% schema coverage the baseline is 3, and the description earns above that: it explains that routeQuotePrice is a caller-reported quote compared against Insight's own on-chain Uniswap V3 quote, that the policy is capped at 50 bps, and that only ETH/WETH, USDC and WBTC on Ethereum are supported while other routes fail closed. targetProviders and sourceGroupCount are left to the schema, which documents them adequately.

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

Purpose4/5

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

The description states a specific action and artifact: it runs the oracle safety check and returns a machine-readable execution certification handle (preTradeUid, requestHash, CAIP-19 ids, certified price, maxSlippageBps). It also disambiguates the misleading tool name by clarifying that the caller executes with their own wallet, and it points to execution_receipt as the follow-on. It stops short of distinguishing itself from siblings like pre_trade_safety_check or execution_preflight.

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?

Timing is explicit — call BEFORE trading, then call execution_receipt with the handle plus txHash after executing. It also states the negative branch: if the verdict is DANGER or BLOCK the tool refuses and 'do not trade'. What is missing is a head-to-head comparison with the other pre-trade siblings (pre_trade_safety_check, execution_preflight), which an agent choosing among 36 tools would need.

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.