Skip to main content
Glama

chain_events

Read-only

Contract event log reader and decoder — Reads and decodes any contract event from chain logs on base|ethereum|arbitrum|optimism|polygon over the last N blocks. event= takes a Solidity-style signature such as Swap(address indexed sender,address indexed recipient,int256 amount0,int256 amount1,uint160 sqrtPriceX96,uint128 liquidity,int24 tick) or a known name (Transfer, Approval, ApprovalForAll, OwnershipTransferred, Deposit, Withdrawal, Upgraded). Computes topic0 (keccak), fetches matching logs and decodes indexed and data arguments (address, bool, intN/uintN, bytesN, string, bytes, T[]); if no parameter is marked indexed the layout is inferred from the logs. Params: chain (default base), contract, event, blocks (default 1000, max 5000), limit (default 25, max 100). Tuples and fixed-size arrays are not supported (400). No contract at the address returns 404 (not charged). Price: $0.004 USDC (Base, via x402).

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>",
      "contract": "<contract>",
      "event": "<event>"
    },
    "name": "chain_events"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesbase
eventYesApproval
contractYes0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld annotations by disclosing error semantics (400 for tuples and fixed-size arrays, 404 for no contract and explicitly 'not charged'), payload caps (blocks max 5000, limit max 100), the topic0 keccak derivation, the indexed-layout inference fallback, and the $0.004 USDC price. These are the operational details an agent needs before spending money on a call.

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?

Dense but front-loaded: the first clause names the operation, then supported types, then parameters, errors, and price in a logical order. The long inline Swap signature example is the bulkiest element but it usefully demonstrates the expected input format rather than padding.

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 high-complexity tool with no output schema, the description covers supported chains, decoding coverage, types handled and not handled, failure modes, and cost — enough to call it correctly. The one gap is return shape and pagination behavior (how many logs come back, how to page past limit=100), which an agent must discover empirically.

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?

The input schema's field descriptions are only bare examples ('base', 'Approval', a literal address), so the description carries the real semantics: event accepts either a full Solidity-style signature or one of a fixed set of known names, chain defaults to base, and the undocumented blocks (default 1000) and limit (default 25) parameters with their maximums are explained here rather than in the schema. This meaningfully exceeds what the structured fields convey.

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 — 'reads and decodes any contract event from chain logs' — and immediately scopes it to named chains (base|ethereum|arbitrum|optimism|polygon) and a block window. This is unambiguous and clearly distinct from sibling tools such as chain_balances or chain_block, which operate on different on-chain resources.

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

Usage Guidelines3/5

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

Usage is implied by the description: use it when you have a contract address plus an event signature or known name and need the decoded logs over the last N blocks. There is no explicit when-not guidance or named alternative (e.g., a raw-logs or ABI-encode sibling) to route between, so the agent must infer the boundary conditions itself.

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