Skip to main content
Glama

Explain one transaction's routing and origin

explain_transaction

Classify a single transaction against the attribution engine: which frontend or router originated the trade and by which evidence, the pools it touched, any fee recipients, and whether it was sandwiched.

Confidence is per-vector and is reported per result -- a calldata suffix is strong evidence a specific frontend tagged the swap, while a fee recipient is indirect evidence and is never rated high. Pass that qualification through instead of stating the frontend flatly.

estimated_volume_usd (only with price=true) is a best-effort spot price on the dominant leg. It is an approximation for orientation and must never be quoted as a settlement figure. Fee amounts are exact raw token integers with no decimals or pricing applied. deep=true costs more upstream credits; leave it off unless a shallow classification came back unattributed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deepNoRun the deeper classification pass. Slower. Worth setting only when the default pass came back unattributed.
chainNoOne of: ethereum, base, arbitrum, optimism. Defaults to ethereum, and an unrecognised value falls back to ethereum rather than failing, so pass the transaction's actual chain explicitly.ethereum
priceNoInclude price and value context alongside the routing classification.
tx_hashYesThe transaction hash, 0x-prefixed hex. Must exist on `chain`: this does not search the other chains, so a hash from the wrong chain returns nothing rather than an error.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / chain / description
      Added value: +"One of: ethereum, base, arbitrum, optimism. Defaults to ethereum, and an unrecognised value falls back to ethereum rather than failing, so pass the transaction's actual chain explicitly."
    • addedInput schema / properties / deep / description
      Added value: +"Run the deeper classification pass. Slower. Worth setting only when the default pass came back unattributed."
    • addedInput schema / properties / price / description
      Added value: +"Include price and value context alongside the routing classification."
    • addedInput schema / properties / tx_hash / description
      Added value: +"The transaction hash, 0x-prefixed hex. Must exist on `chain`: this does not search the other chains, so a hash from the wrong chain returns nothing rather than an error."
  2. First observed

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the transparency burden and does so fully: it discloses upstream credit costs for deep mode, the fallback behavior for unrecognized chains, and the approximate nature of the price estimate. It also explains that fee amounts are exact raw integers, setting accurate expectations about the response content.

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

Conciseness5/5

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

The description is dense but every sentence adds operational value: scope, evidence types, confidence caveats, cost guidance, and caveats about numeric precision. It is well-structured with no filler or redundant phrases.

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?

Even without an output schema, the description enumerates what the result contains: frontend/router attribution, evidence, pools, fee recipients, sandwich status, price context when requested, and fee amount semantics. It also covers input behavior, cost implications, and precision limits, making the tool fully understandable for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All four parameters are described beyond the schema: tx_hash is tied to a specific chain and wrong-chain hashes return nothing; chain lists accepted values and its fallback behavior; deep explains when to enable it; price explains what it adds. The descriptions add decision-relevant meaning rather than re-stating field names.

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?

The description states a specific verb ('Classify') and a concrete resource scope: a single transaction's routing origin, evidence, pools touched, fee recipients, and sandwich status. It also clarifies that this is the single-transaction explanation tool versus the broader attribution engine, making its purpose distinct.

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

Usage Guidelines5/5

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

The description gives explicit usage direction: 'deep=true costs more upstream credits' and should be left off unless the shallow pass came back unattributed; 'price=true' is required for estimated volume; the chain default fallback behavior is flagged; and the warning not to quote the volume as a settlement figure is clear. This tells the agent exactly when and how to invoke the tool.

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