Skip to main content
Glama
lienhage

Blockchain MCP Server

by lienhage

keccak256

keccak256

Compute the keccak256 hash of input data, a cryptographic function essential for Ethereum blockchain operations like address generation and smart contract interactions.

Instructions

calculate keccak256 hash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesdata to hash

Implementation Reference

  • The async handler function for the 'keccak256' tool. It takes a 'data' input string, computes its Keccak-256 hash using ethers.keccak256(ethers.toUtf8Bytes(data)), and returns a text response with the hash.
    async ({ data }) => {
      const hash = ethers.keccak256(ethers.toUtf8Bytes(data));
      return {
        content: [{ type: "text", text: `keccak256 hash: ${hash}` }]
      };
    }
  • The schema definition for the 'keccak256' tool, including title, description, and Zod inputSchema requiring a 'data' string.
    {
      title: "keccak256",
      description: "calculate keccak256 hash",
      inputSchema: {
        data: z.string().describe("data to hash"),
      }
    },
  • The registration of the 'keccak256' tool via server.registerTool call within UtilsService.registerWithServer method.
    // tool to calculate keccak256 hash
    server.registerTool(
      "keccak256",
      {
        title: "keccak256",
        description: "calculate keccak256 hash",
        inputSchema: {
          data: z.string().describe("data to hash"),
        }
      },
      async ({ data }) => {
        const hash = ethers.keccak256(ethers.toUtf8Bytes(data));
        return {
          content: [{ type: "text", text: `keccak256 hash: ${hash}` }]
        };
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states what the tool does ('calculate keccak256 hash') but provides no information about performance characteristics, error conditions, input validation, or output format. For a cryptographic tool with zero annotation coverage, this represents a significant gap in behavioral transparency.

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 description is extremely concise at just three words, with zero wasted language. Every word earns its place: 'calculate' specifies the action, 'keccak256' identifies the algorithm, and 'hash' clarifies the operation type. This is a model of efficiency for a simple, single-purpose tool.

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

Completeness3/5

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

Given the tool's simplicity (single parameter, no output schema, no annotations), the description is minimally adequate. It identifies the core function but lacks important context about input encoding, output format, and error handling. For a cryptographic hash function, users need to know whether input should be hex-encoded, UTF-8, etc., and what format the hash output will be in.

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 description coverage is 100%, with the single parameter 'data' clearly documented as 'data to hash'. The description doesn't add any additional semantic information beyond what the schema provides - it doesn't specify encoding requirements, size limitations, or formatting expectations. With complete schema coverage, 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.

Purpose4/5

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

The description clearly states the tool's purpose as 'calculate keccak256 hash', which is a specific verb ('calculate') and resource ('keccak256 hash'). It distinguishes itself from sibling tools like 'abi-encode' or 'send-transaction' by focusing specifically on hash calculation. However, it doesn't explicitly differentiate from other potential hash functions that might exist in the ecosystem.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of when keccak256 hashing is appropriate versus other hash functions, nor does it reference any of the sibling tools that might serve related purposes. The user must infer usage from the tool name alone.

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

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lienhage/blockchain-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server