Skip to main content
Glama

PG1 Sovereign Threat Intelligence

check_swap_intent

PG1 Sovereign Threat Intelligence: checks an unsigned swap against the owner's instructions BEFORE it reaches the signer. Send the EIP-1559 transaction (type 0x02, unsigned or signed) as hex and the intent: chain_id, recipient (who must receive the output) and min_amount_out (the floor, in the output token's smallest units) are required; router (one permitted address or a list), token_in, token_out, amount_in, native_value, fee_tier, payer_is_user, signer (to resolve output sent to msg.sender), as_of (the reference time for the deadline; now by default), max_deadline_seconds and max_fee_bips are optional, and each one you give is checked. Optionally expected_sha256 of the transaction bytes. PG1 decodes the raw bytes itself (never trusts decoded fields sent alongside): the Universal Router's execute(bytes,bytes[],uint256) or execute(bytes,bytes[]) with V3_SWAP_EXACT_IN, V2_SWAP_EXACT_IN, SWEEP, UNWRAP_WETH, WRAP_ETH, PERMIT2_PERMIT (the permit must name the router as spender) and PAY_PORTION (interface fees, checked against max_fee_bips), following output held by the router (address(2)) to where it is swept or unwrapped; and the Aerodrome / Velodrome v2 router's exact-input swaps (swapExactTokensForTokens, swapExactETHForTokens, swapExactTokensForETH and their fee-on-transfer variants). Any other function or command is reported as not evaluated, never guessed. Reason codes, high: SWAP_RECIPIENT_MISMATCH, SWAP_MIN_OUT_BELOW_FLOOR (with the shortfall), SWAP_ROUTER_NOT_PERMITTED, SWAP_CHAIN_MISMATCH, SWAP_TOKEN_MISMATCH, SWAP_AMOUNT_IN_MISMATCH, SWAP_NATIVE_VALUE_MISMATCH, SWAP_DEADLINE_PASSED, SWAP_PERMIT_SPENDER_NOT_ROUTER, SWAP_OUTPUT_LEFT_IN_ROUTER (output the router still holds at the end, which anyone could sweep), SWAP_TX_DIGEST_MISMATCH; medium: SWAP_FEE_TIER_MISMATCH, SWAP_PAYER_MISMATCH, SWAP_DEADLINE_TOO_FAR, SWAP_NO_DEADLINE, SWAP_FEE_ABOVE_LIMIT; SWAP_INTENT_NOT_EVALUATED makes the status unknown. Returns verdict does_not_match, review, not_evaluated or matches_intent, one intent_checks row per field (match, mismatch or not_evaluated, with expected and actual), the decoded transaction and commands, and where each output goes. matches_intent means the transaction does what the intent asks; it does not judge the tokens, router, price or anything on chain, and is never "safe" or advice to sign. Deterministic, no network, no AI model; nothing is signed, sent or stored. Always free (60/hour per caller).

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": {
      "transaction": "<transaction>",
      "intent": "<intent>"
    },
    "name": "check_swap_intent"
  }
}

Input Schema

NameRequiredDescriptionDefault
intentYesThe owner's instructions. Every field given is checked; fields left out are reported as not_evaluated.
transactionYesThe EIP-1559 transaction (type 0x02), unsigned or signed, as 0x hex.
expected_sha256NoOptional: the SHA-256 you expect of the transaction bytes.

Output Schema

NameRequiredDescriptionDefault
callNo
noteNo
checksNoWhich underlying sources were checked for this result and whether each one completed.
statusNo"unknown" whenever a source needed for this answer timed out, errored, or was skipped - never "no_flags" in that case.
reasonsNoMachine-readable reason codes for anything flagged in this result. Empty when nothing was flagged.
summaryYes
verdictYes
findingsYes
deliveriesNo
request_idNoUUID for this request, also sent as the X-Request-Id response header.
transactionYes
intent_checksYes
not_evaluatedYes
rules_versionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / findings / items / properties / code / enum
      Previous value: -[
      -  "SWAP_TX_DIGEST_MISMATCH",
      -  "SWAP_CHAIN_MISMATCH",
      -  "SWAP_ROUTER_NOT_PERMITTED",
      -  "SWAP_RECIPIENT_MISMATCH",
      -  "SWAP_MIN_OUT_BELOW_FLOOR",
      -  "SWAP_TOKEN_MISMATCH",
      -  "SWAP_AMOUNT_IN_MISMATCH",
      -  "SWAP_NATIVE_VALUE_MISMATCH",
      -  "SWAP_DEADLINE_PASSED",
      -  "SWAP_PERMIT_SPENDER_NOT_ROUTER",
      -  "SWAP_FEE_TIER_MISMATCH",
      -  "SWAP_PAYER_MISMATCH",
      -  "SWAP_DEADLINE_TOO_FAR",
      -  "SWAP_NO_DEADLINE",
      -  "SWAP_FEE_ABOVE_LIMIT",
      -  "SWAP_INTENT_NOT_EVALUATED"
      -]New value: +[
      +  "SWAP_TX_DIGEST_MISMATCH",
      +  "SWAP_CHAIN_MISMATCH",
      +  "SWAP_ROUTER_NOT_PERMITTED",
      +  "SWAP_RECIPIENT_MISMATCH",
      +  "SWAP_MIN_OUT_BELOW_FLOOR",
      +  "SWAP_TOKEN_MISMATCH",
      +  "SWAP_AMOUNT_IN_MISMATCH",
      +  "SWAP_NATIVE_VALUE_MISMATCH",
      +  "SWAP_DEADLINE_PASSED",
      +  "SWAP_PERMIT_SPENDER_NOT_ROUTER",
      +  "SWAP_OUTPUT_LEFT_IN_ROUTER",
      +  "SWAP_FEE_TIER_MISMATCH",
      +  "SWAP_PAYER_MISMATCH",
      +  "SWAP_DEADLINE_TOO_FAR",
      +  "SWAP_NO_DEADLINE",
      +  "SWAP_FEE_ABOVE_LIMIT",
      +  "SWAP_INTENT_NOT_EVALUATED"
      +]
  2. Added

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: deterministic, no network, no AI model, nothing signed/sent/stored, 60/hour rate limit, and an explicit disclaimer that 'matches_intent' is not a safety judgement. It also discloses coverage boundaries (which functions are and are not evaluated) and the semantics of each verdict.

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 intent fields are front-loaded, but the body is one dense run-on paragraph layering supported commands and a long enumerated reason-code list. The content largely earns its place, yet the delivery is hard to scan and could be structured more cleanly.

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?

For a high-complexity cryptographic verification tool with nested intent parameters, the description covers determinism, coverage limits, verdict meaning, and disclaimers; an output schema exists, so return-value explanation is not required. Nothing an agent needs to invoke it correctly 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 each field, but the description adds meaning: required vs optional fields, that every supplied field is checked and omitted ones report not_evaluated, the router as a permitted address or list, signer's purpose for resolving msg.sender output, and as_of defaulting to now. This goes beyond restating the schema.

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: 'checks an unsigned swap against the owner's instructions BEFORE it reaches the signer.' This is immediately distinguishable from the sibling reputation/threat checks (check_domain_age, check_wallet_age, etc.) without opening a schema.

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 'BEFORE it reaches the signer' framing gives a clear moment to use the tool, and the not_evaluated coverage rule tells the agent when results will be unknown. It does not explicitly name alternatives or when-not-to-use, keeping it just short of a 5.

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.