Skip to main content
Glama

Pre-execution Safety Check

pacta_check_preflight
Read-onlyIdempotent

Run a one-call pre-execution safety check on a contract before an agent interacts, returning a control-plane verdict, 0–100 risk score, proxy/admin details, and pause, blacklist, or upgrade risks.

Instructions

Gateway tool (requires PACTA_X402_URL; x402 $0.01 Base USDC when metered). One-call pre-execution safety check of a contract before an agent interacts with it: verdict (IMMUTABLE_NO_ADMIN / TIMELOCK_PROTECTED / ZERO_DELAY_TIMELOCK_RISK / MULTISIG_NO_TIMELOCK / INSTANT_EOA_ADMIN_RISK / UNCLASSIFIED_CONTRACT_CONTROLLER / UNDEPLOYED_OR_EOA), 0-100 risk score, proxy + implementation, controller kind, zero-delay upgradeability, pause / blacklist / upgrade capabilities, pinned block. Free during the launch (the live gateway answers $0, no payment); x402 price applies only if metering is switched on.

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": {
      "chain": "<chain>",
      "address": "<address>"
    },
    "name": "pacta_check_preflight"
  }
}

Input Schema

NameRequiredDescriptionDefault
blockNoBlock to pin: "latest" (default), a decimal block number or 0x-hex.
chainYes
nonceNo0x-prefixed 32-byte hex nonce.
payerNo0x payer address for 402 EIP-712 typedData.
addressYes
x402VersionNoPreferred x402 version for the 402 challenge (default 1). Both are validated under the same pins.
caller_agentNoIdentifier of the calling AI agent, IDE, or framework (e.g. 'claude-code', 'cursor', 'windsurf', 'coinbase-agentkit', 'elizaos', 'langchain', 'chatgpt', 'gemini', 'custom-agent'). Optional attribution (omitted = 'unspecified'). Lowercase slug only; never include personal names, emails, or secrets.
caller_purposeNoOptional: operational workflow context for this pre-execution check (closed enum).
requester_roleNoOptional: high-level role category of the requester or system running this check (closed enum; no personal data).
xPaymentHeaderNoBase64 x402 v1 X-PAYMENT header (network base).
validBeforeSecondsNoTTL for the 402 typedData; clamped to the validated challenge's maxTimeoutSeconds.
paymentSignatureHeaderNoBase64 x402 v2 PAYMENT-SIGNATURE header (network eip155:8453). Send this OR xPaymentHeader, not both.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.1.4
    • changedInput schema / properties / caller_agent / description
      Previous value: -"Identifier of the calling AI agent, IDE, or framework (e.g. 'claude-code', 'cursor', 'windsurf', 'coinbase-agentkit', 'elizaos', 'langchain', 'chatgpt', 'gemini', 'custom-agent'). Required on the free MCP tier. Lowercase slug only; never include personal names, emails, or secrets."New value: +"Identifier of the calling AI agent, IDE, or framework (e.g. 'claude-code', 'cursor', 'windsurf', 'coinbase-agentkit', 'elizaos', 'langchain', 'chatgpt', 'gemini', 'custom-agent'). Optional attribution (omitted = 'unspecified'). Lowercase slug only; never include personal names, emails, or secrets."
    • changedInput schema / properties / caller_purpose / description
      Previous value: -"Operational workflow context for this pre-execution check (closed enum)."New value: +"Optional: operational workflow context for this pre-execution check (closed enum)."
    • changedInput schema / properties / requester_role / description
      Previous value: -"High-level role category of the requester or system running this check (closed enum; no personal data)."New value: +"Optional: high-level role category of the requester or system running this check (closed enum; no personal data)."
    • changedInput schema / required
      Previous value: -[
      -  "chain",
      -  "address",
      -  "caller_agent",
      -  "requester_role",
      -  "caller_purpose"
      -]New value: +[
      +  "chain",
      +  "address"
      +]
  2. Addedv0.1.3

TDQS

A3.6/5.0
Behavior3/5

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

Given the description's readOnly/idempotent/non-destructive annotations, the safety profile is already covered. Beyond that it adds real context: the gateway URL requirement, cost ($0.01 Base USDC when metered), the launch-time free tier, and block pinning. It does not cover error or failure behavior for the read, and the 'openWorldHint: false' annotation sits awkwardly with a tool that pays over x402 and reads live chain state, though this is a soft tension rather than a direct contradiction.

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

Conciseness4/5

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

The purpose and the enumeration of returned verdicts are front-loaded and dense with information. The pricing fact is stated twice ('x402 $0.01 Base USDC when metered' and again in the closing sentence about metering being switched on), which is mild redundancy in an otherwise tight definition.

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 listing the returned fields: verdict, 0-100 risk score, proxy and implementation, controller kind, zero-delay upgradeability, pause/blacklist/upgrade capabilities, and pinned block. The billing and gating story is also complete. Only error handling and the relationship to the sibling scan tools are left unstated for a 12-parameter tool.

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 83%, so the schema already documents block, nonce, payer, caller_agent, caller_purpose, requester_role, and the two mutually exclusive payment headers. The description adds nothing about any of the 12 parameters and does not restate the 'send xPaymentHeader OR paymentSignatureHeader, not both' constraint, so baseline 3 applies.

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 names a specific verb and resource: 'One-call pre-execution safety check of a contract before an agent interacts with it,' and it enumerates the exact verdict taxonomy (IMMUTABLE_NO_ADMIN through UNDEPLOYED_OR_EOA) plus the risk-score output. That is far more specific than the title alone. It never names a sibling such as pacta_scan_control_plane or pacta_live_timelocks to draw the boundary, so an agent must infer the split itself.

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 gives clear timing guidance: run this before an agent interacts with a contract. It does not state exclusions (e.g. when to prefer the scan or list tools instead) or prerequisites beyond the PACTA_X402_URL requirement, leaving the sibling routing to the agent.

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