Skip to main content
Glama

Function selector and event topic

util_selector

Turns a Solidity signature like transfer(address,uint256) into its 4-byte function selector and its 32-byte event topic0. What you need to build calldata by hand or to filter logs. Flat $0.001 per call, paid over x402 (USDC).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
signatureYesCanonical signature: name(type1,type2), no spaces and no argument names.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the operation (conversion), the output specifics (4-byte and 32-byte), and the cost ($0.001 per call, paid via x402). It does not cover error cases or edge conditions, but for a single-parameter utility this is adequate.

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?

Two sentences: the first states the core function with an example, the second states the use case and cost. No fluff, well-front-loaded, every word earns its place.

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?

The description explains the output format (selector and topic0) and the use cases, which is sufficient for a tool with one simple parameter. It doesn't mention return value encoding (hex vs raw) but that is implied and not critical. The cost is also disclosed. Minor gaps like error handling are acceptable.

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 coverage is 100% and the schema already describes the signature format. The description adds an example (transfer(address,uint256)) which reinforces the format but does not introduce new semantics beyond the schema. Baseline 3 is appropriate.

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 clearly states the tool's function: it converts a Solidity signature into a 4-byte function selector and 32-byte event topic0, with a concrete example. This distinguishes it from generic hash utilities like util_keccak256 by specifying the exact output and purpose (building calldata or filtering logs).

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?

It explicitly states when to use it: 'What you need to build calldata by hand or to filter logs.' While it doesn't name alternatives or when not to use it, the use cases are clear and the context is sufficient for an agent to decide when this tool is appropriate.

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