Skip to main content
Glama

cast_sig

Converts an Ethereum function signature, such as transfer(address,uint256), into its 4-byte selector for use in calldata, contract calls, and ABI encoding tasks.

Instructions

Get the 4-byte function selector from a function signature (cast sig).

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": "cast_sig"
  }
}

Input Schema

NameRequiredDescriptionDefault
signatureYesFunction signature, e.g. "transfer(address,uint256)"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral burden; it does disclose the output (a 4-byte selector), which is the essential behavior for a deterministic pure computation. It says nothing about input normalization (spaces, 'function ... returns' forms) or behavior for malformed signatures, leaving a real gap for a tool with zero annotation coverage.

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?

One short sentence, front-loaded with the verb and the produced artifact, with no filler; the parenthetical CLI alias is compact and useful.

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 1-parameter pure conversion tool with no output schema and no annotations, the description is nearly complete: it names the input and the exact output. Only the treatment of malformed or differently formatted signatures is unaddressed.

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 single parameter already carries an example ('transfer(address,uint256)' with no spaces). The description only restates that the input is a function signature, adding no meaning beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: derive the 4-byte function selector from a function signature, plus the CLI alias '(cast sig)'. An agent can tell it apart from most siblings, though it does not explicitly distinguish itself from the closely related cast_keccak (selector = first 4 bytes of the keccak of the signature).

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?

No explicit when-to-use or when-not-to-use guidance is given; the usage is implied by the tool's narrow purpose (you have a function signature string and need a selector). It also does not route to alternatives such as cast_keccak, so an agent must infer the boundary itself.

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