Skip to main content
Glama

chain_selector

Read-only

Function selector and event topic calculator — Compute the 4-byte function selector (or error selector) and the 32-byte event topic0 for Solidity signatures with keccak-256, offline. Accepts human-readable signatures with parameter names, indexed and memory modifiers, uint/int shorthands and tuples (e.g. function transfer(address to, uint amount) or event Transfer(address indexed from,address indexed to,uint256 value)); returns the canonical form, selector, full hash and known-function matches. signature= required; up to 20 separated by ;. Price: $0.001 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": {
      "signature": "<signature>"
    },
    "name": "chain_selector"
  }
}

Input Schema

NameRequiredDescriptionDefault
signatureYestransfer(address,uint256)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds real context beyond that: the computation is offline keccak-256, the tool also returns known-function matches, and — importantly — invocation costs $0.001 USDC on Base via x402, which affects whether an agent should call it.

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?

One dense but front-loaded block: purpose first, then accepted input forms, then outputs, then price. It is long for a single-parameter tool but nearly every clause carries information; the price note could arguably be separated from the technical description.

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?

There is no output schema, so the description carries the return burden and does so by enumerating canonical form, selector, full hash and known-function matches. The only gap is error behavior for malformed or ambiguous signatures.

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% but the schema only supplies a bare example. The description adds genuine meaning: parameter names, indexed/memory modifiers, uint/int shorthands and tuples are tolerated, and the single 'signature' field accepts up to 20 entries separated by ';'.

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: computes the 4-byte function/error selector and 32-byte event topic0 from Solidity signatures via keccak-256. The mention of 'offline' and of both function and event signatures makes it clearly distinct from decode/calldata-oriented siblings.

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 input format (human-readable signatures, up to 20 separated by ';') and by 'offline', so an agent can infer it is a pure computation tool needing no network or address. However, it never states when to prefer this over a decoding sibling or what happens for unparseable signatures.

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