Skip to main content
Glama

Keccak-256 hash

keccak256
Read-onlyIdempotent

Ethereum keccak256 of the input: returns the 32-byte digest and the 4-byte selector. encoding auto (default) hashes 0x-hex input as bytes and anything else as UTF-8 text; force utf8 or hex explicitly. The empty string is allowed. Up to 250000 bytes. Price: $0.01 USDC per call on Base mainnet ($0.001 on Base Sepolia), paid with x402; failed calls are not charged.

Input Schema

NameRequiredDescriptionDefault
dataYesData to hash, e.g. transfer(address,uint256) or 0xdeadbeef.
encodingNoauto (default), utf8, or hex.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / data / description
      Previous value: -"Data to hash (e.g. a function signature like transfer(address,uint256))."New value: +"Data to hash, e.g. transfer(address,uint256) or 0xdeadbeef."
    • changedInput schema / properties / encoding / description
      Previous value: -"Input encoding: utf8 (default) or hex."New value: +"auto (default), utf8, or hex."
    • changedInput schema / properties / encoding / enum
      Previous value: -[
      -  "utf8",
      -  "hex"
      -]New value: +[
      +  "auto",
      +  "utf8",
      +  "hex"
      +]
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

The description goes far beyond the safety hints provided in the annotations (which only state readOnlyHint: true). It provides critical operational context, including input limits ('Up to 250000 bytes'), detailed encoding behavior, and specific pricing information ('$0.01 USDC per call').

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 information is dense but highly efficient. It front-loads the core functional definition (the hash operation and its output) and efficiently follows up with all necessary constraints (encoding rules, limits, pricing).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Since there is no output schema, the description is remarkably complete. It explains what the tool returns, defines all encoding constraints, and details operational costs, leaving no ambiguity for the agent.

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?

Although schema coverage is 100%, the description adds crucial functional semantics. It provides concrete examples for the `data` parameter ('transfer(address,uint256) or 0xdeadbeef') and clearly explains the nuanced difference between the three `encoding` options.

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 is highly specific, stating that the tool performs the 'Ethereum keccak256' operation and defines its precise output structure: 'returns the 32-byte digest and the 4-byte selector.' This level of detail clearly distinguishes it from general hashing siblings like eip712.hash.

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?

While it does not explicitly state 'use this vs alternative X,' the detailed description of encoding types (auto vs utf8 vs hex) and the specific output format effectively dictates the precise conditions under which this tool must be chosen over a general hash function.

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