Skip to main content
Glama
lienhage

Blockchain MCP Server

by lienhage

sig

sig

Generate function selectors from Ethereum smart contract function signatures. Input a function signature to derive the corresponding selector for blockchain interactions.

Instructions

get function selector

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
functionNameYesfunction signature, e.g. 'transfer(address,uint256)'

Implementation Reference

  • The handler function that computes the Ethereum function selector (first 4 bytes of keccak256 hash of the function signature).
    async ({ functionName }) => {
      const functionSelector = ethers.keccak256(ethers.toUtf8Bytes(functionName)).slice(0, 10);
      return {
        content: [{ type: "text", text: `function selector: ${functionSelector}` }]
      };
    }
  • The tool metadata including title, description, and input schema using Zod for validation.
      title: "sig",
      description: "get function selector",
      inputSchema: {
        functionName: z.string().describe("function signature, e.g. 'transfer(address,uint256)'"),
      }
    },
  • Registers the 'sig' tool on the MCP server using server.registerTool.
      "sig",
      {
        title: "sig",
        description: "get function selector",
        inputSchema: {
          functionName: z.string().describe("function signature, e.g. 'transfer(address,uint256)'"),
        }
      },
      async ({ functionName }) => {
        const functionSelector = ethers.keccak256(ethers.toUtf8Bytes(functionName)).slice(0, 10);
        return {
          content: [{ type: "text", text: `function selector: ${functionSelector}` }]
        };
      }
    );
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. It only states the action ('get') without detailing how it works—e.g., whether it computes a keccak256 hash, returns a hex string, handles errors, or has any side effects. For a tool with no annotation coverage, this leaves critical behavioral traits unspecified.

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—just three words—and front-loaded with the core action. There is no wasted language, making it efficient, though this brevity contributes to gaps in other dimensions like clarity and transparency.

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

Completeness2/5

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

Given the complexity of Ethereum tooling and the lack of annotations and output schema, the description is incomplete. It doesn't explain what a function selector is, how it's used, or what the return value looks like (e.g., a 4-byte hex). For a tool in this context, more detail is needed to guide an AI agent effectively.

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 schema description coverage is 100%, with the parameter 'functionName' clearly documented in the input schema as a string representing a function signature. The description adds no additional meaning beyond what the schema provides, such as examples of valid formats or constraints, so it meets the baseline score of 3 for high schema coverage.

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

Purpose2/5

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

The description 'get function selector' is essentially a tautology that restates the tool name 'sig' (which likely means 'signature' or 'selector'). It doesn't specify what a 'function selector' is, what domain it operates in (Ethereum/smart contracts), or what resource it acts upon. While it implies retrieval, the purpose remains vague without context about the function selector's role or format.

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?

No guidance is provided on when to use this tool versus alternatives. Given sibling tools like '4byte', 'abi-encode', and 'event-sig' that likely handle related Ethereum/smart contract operations, the description fails to differentiate this tool's specific use case, such as generating selectors for function calls versus events or other encoding tasks.

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