Skip to main content
Glama

sign-message

Sign messages using MetaMask wallet for blockchain interactions without exposing private keys. This tool enables secure message signing within AI-powered applications.

Instructions

Sign messages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYes

Implementation Reference

  • The execute handler for the 'sign-message' tool. It extracts the message from args, calls wagmi's signMessage with the configured wagmiConfig, returns the signature hash as a JSON string in MCP content format, logs and rethrows errors.
    execute: async (args, { log }) => {
      try {
        const message = args.message
        const result = await signMessage(wagmiConfig, {
          message
        })
        return {
          content: [
            {
              type: "text",
              text: JSONStringify({
                hash: result
              }),
            },
          ],
        }
      } catch (error) {
        log.debug((error as Error).message)
        throw error;
      }
  • Zod schema defining the input parameters for the tool: a single 'message' string.
    parameters: z.object({
      message: z.string(),
    }),
  • The registerSignMessageTools function that defines and registers the 'sign-message' tool on the FastMCP server, including name, description, schema, and handler.
    export function registerSignMessageTools(server: FastMCP): void {
      server.addTool({
        name: "sign-message",
        description: "Sign messages",
        parameters: z.object({
          message: z.string(),
        }),
        execute: async (args, { log }) => {
          try {
            const message = args.message
            const result = await signMessage(wagmiConfig, {
              message
            })
            return {
              content: [
                {
                  type: "text",
                  text: JSONStringify({
                    hash: result
                  }),
                },
              ],
            }
          } catch (error) {
            log.debug((error as Error).message)
            throw error;
          }
        },
      });
    };
  • The call to registerSignMessageTools during server initialization in the main entry point.
    registerSignMessageTools(server);
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Sign messages' gives no information about whether this is a read or write operation, what permissions are required, whether it's destructive, what the output looks like, or any rate limits. This is inadequate for a tool that likely performs cryptographic operations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just two words, which could be appropriate if it were more informative. However, this brevity results in under-specification rather than efficient communication, though it's technically front-loaded with the core action.

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

Completeness1/5

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

Given the complexity of cryptographic signing operations, no annotations, no output schema, and 0% schema description coverage, the description is completely inadequate. It doesn't explain what signing algorithm is used, what keys are involved, what the output format is, or any error conditions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and 1 required parameter, the description provides no information about the 'message' parameter. It doesn't explain what format the message should be in, what encoding is expected, size limitations, or any constraints. The description fails to compensate for the complete lack of schema documentation.

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 'Sign messages' is a tautology that restates the tool name 'sign-message' without adding specificity. It doesn't indicate what type of signing (cryptographic, blockchain, etc.), what resource is being signed, or how it differs from sibling tools like 'verify-message'.

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

Usage Guidelines1/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. With sibling tools like 'verify-message' and 'send-transaction' that might be related, there's no indication of appropriate contexts, prerequisites, or exclusions for this signing operation.

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

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/Xiawpohr/mcpilot'

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