Skip to main content
Glama

wallet_sign_message

Sign messages securely using the MCP Crypto Wallet EVM server. Enable Ethereum and EVM-compatible blockchain operations by providing a wallet (private key, mnemonic, or JSON) and the message to sign.

Instructions

Sign a message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesThe message to sign
walletNoThe wallet (private key, mnemonic, or JSON). If not provided, uses PRIVATE_KEY environment variable if set.

Implementation Reference

  • The core handler function that performs the message signing using the ethers Wallet instance's signMessage method. It retrieves the wallet using getWallet helper, signs the message, and returns the signature.
    export const signMessageHandler = async (input: any): Promise<ToolResultSchema> => { try { if (!input.message) { return createErrorResponse("Message is required"); } const wallet = await getWallet(input.wallet, input.password); const signature = await wallet.signMessage(input.message); return createSuccessResponse(`Message signed successfully Signature: ${signature} Message: "${input.message}" `); } catch (error) { return createErrorResponse(`Failed to sign message: ${(error as Error).message}`); } };
  • Defines the tool metadata including name, description, and input schema (wallet optional, message required) for validation in the MCP tool system.
    { name: "wallet_sign_message", description: "Sign a message", inputSchema: { type: "object", properties: { wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON). If not provided, uses PRIVATE_KEY environment variable if set." }, message: { type: "string", description: "The message to sign" } }, required: ["message"] } },
  • src/tools.ts:583-584 (registration)
    Registers the signMessageHandler function to the 'wallet_sign_message' tool name in the handlers dictionary, mapping tool calls to the implementation.
    // Signing Methods "wallet_sign_message": signMessageHandler,

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/dcSpark/mcp-cryptowallet-evm'

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