Skip to main content
Glama
franckyo
by franckyo

Compute function selectors

function_selector
Read-only

Generate 4-byte selectors from canonical function signatures to decode calldata and analyze EVM contracts.

Instructions

Compute 4-byte selectors from canonical signatures, e.g. transfer(address,uint256).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
signaturesYesCanonical signatures, no argument names or spaces.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already set readOnlyHint=true, so the safety profile is covered. The description adds that this is a pure computation ('Compute') but does not discuss error behavior, invalid-signature handling, or output formatting. It is coherent with annotations and provides no contradicting information, but adds limited behavioral context beyond what annotations provide.

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 entire description is a single sentence with an illustrative example and zero filler. The core action and input type are front-loaded, making it easy to parse quickly.

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 simple read-only compute tool, the description is mostly complete: it names the input format and the output concept (4-byte selectors). However, since there is no output schema, it does not specify whether selectors are returned as hex strings with a '0x' prefix or in some other encoding. This is a minor gap for such a straightforward utility.

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?

The input schema already documents the 'signatures' parameter with 'Canonical signatures, no argument names or spaces,' giving 100% coverage. The description's example reinforces the expected format but does not add meaning beyond the schema, so the baseline score of 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 opens with the specific verb 'Compute' and resource '4-byte selectors from canonical signatures,' making the tool's function immediately unambiguous. The example 'transfer(address,uint256)' anchors the expected input and clearly distinguishes this from siblings like decode_calldata or compute_storage_slot.

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 a concrete example and specifies the input as 'canonical signatures,' which implies when this tool is appropriate. It does not explicitly name alternatives or exclusions, but the narrow scope leaves little ambiguity; an agent can infer this is for signature-to-selector conversion and not for decoding calldata or reading storage.

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