Skip to main content
Glama

sign_message

Generate cryptographic signatures for messages or EIP-712 typed data to verify authenticity and integrity in blockchain transactions.

Instructions

Sign a message (personal_sign) or EIP-712 typed data (signTypedData). Returns the signature. EIP-712 is EVM-only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNoMessage to sign (hex 0x-prefixed or UTF-8 string). Required for sign_type "personal".
sign_typeNoSign type: "personal" (default) for raw message, "typedData" for EIP-712.
typed_dataNoEIP-712 typed data structure. Required when sign_type is "typedData".
networkNoTarget network (optional).
wallet_idNoTarget wallet ID. Required for multi-wallet sessions.

Implementation Reference

  • The tool handler logic that prepares the API request body and calls the sign-message endpoint.
        async (args) => {
          const body: Record<string, unknown> = {};
          if (args.message) body.message = args.message;
          if (args.sign_type) body.signType = args.sign_type;
          if (args.typed_data) body.typedData = args.typed_data;
          if (args.network) body.network = args.network;
          if (args.wallet_id) body.walletId = args.wallet_id;
          const result = await apiClient.post('/v1/transactions/sign-message', body);
          return toToolResult(result);
        },
      );
    }
  • The Zod schema validation definition for the 'sign_message' tool arguments.
    {
      message: z.string().optional().describe('Message to sign (hex 0x-prefixed or UTF-8 string). Required for sign_type "personal".'),
      sign_type: z.enum(['personal', 'typedData']).optional().describe('Sign type: "personal" (default) for raw message, "typedData" for EIP-712.'),
      typed_data: z.object({
        domain: z.object({
          name: z.string().optional(),
          version: z.string().optional(),
          chainId: z.union([z.number(), z.string()]).optional(),
          verifyingContract: z.string().optional(),
          salt: z.string().optional(),
        }),
        types: z.record(z.array(z.object({ name: z.string(), type: z.string() }))),
        primaryType: z.string(),
        message: z.record(z.unknown()),
      }).optional().describe('EIP-712 typed data structure. Required when sign_type is "typedData".'),
      network: z.string().optional().describe('Target network (optional).'),
      wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions.'),
    },
  • Registration function that registers the 'sign_message' tool on the MCP server.
    export function registerSignMessage(
      server: McpServer,
      apiClient: ApiClient,
      walletContext?: WalletContext,
    ): void {
      server.tool(
        'sign_message',
        withWalletPrefix(
          'Sign a message (personal_sign) or EIP-712 typed data (signTypedData). Returns the signature. EIP-712 is EVM-only.',
          walletContext?.walletName,
        ),
        {
          message: z.string().optional().describe('Message to sign (hex 0x-prefixed or UTF-8 string). Required for sign_type "personal".'),
          sign_type: z.enum(['personal', 'typedData']).optional().describe('Sign type: "personal" (default) for raw message, "typedData" for EIP-712.'),
          typed_data: z.object({
            domain: z.object({
              name: z.string().optional(),
              version: z.string().optional(),
              chainId: z.union([z.number(), z.string()]).optional(),
              verifyingContract: z.string().optional(),
              salt: z.string().optional(),
            }),
            types: z.record(z.array(z.object({ name: z.string(), type: z.string() }))),
            primaryType: z.string(),
            message: z.record(z.unknown()),
          }).optional().describe('EIP-712 typed data structure. Required when sign_type is "typedData".'),
          network: z.string().optional().describe('Target network (optional).'),
          wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions.'),
        },
        async (args) => {
          const body: Record<string, unknown> = {};
          if (args.message) body.message = args.message;
          if (args.sign_type) body.signType = args.sign_type;
          if (args.typed_data) body.typedData = args.typed_data;
          if (args.network) body.network = args.network;
          if (args.wallet_id) body.walletId = args.wallet_id;
          const result = await apiClient.post('/v1/transactions/sign-message', body);
          return toToolResult(result);
        },
      );
    }
Behavior3/5

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

Adds valuable constraints not in annotations ('EIP-712 is EVM-only', 'Returns the signature'). However, missing critical behavioral context for a signing operation: no mention of user confirmation requirements, security implications, or wallet authorization prerequisites.

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?

Three sentences with zero waste: action definition first, return value second, platform constraint third. Appropriately sized and front-loaded.

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?

Adequate for the tool's complexity given excellent schema coverage, but incomplete regarding operational safety (no warnings about irreversible signing or private key usage) and prerequisites (wallet connection state).

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 has 100% description coverage, establishing baseline 3. Description maps sign_type values to protocol names ('personal_sign', 'signTypedData') but adds no additional syntax, format details, or cross-parameter relationships beyond the schema.

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?

Clearly states the action ('Sign') and resources ('message', 'EIP-712 typed data'), referencing specific protocols (personal_sign, signTypedData). Distinguishes implicitly from siblings like sign_transaction by focusing on 'message' rather than 'transaction', though explicit contrast would strengthen this.

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

Usage Guidelines3/5

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

Provides internal usage guidance by explaining the two sign_type modes ('personal' vs 'typedData'), but lacks external guidance on when to select this tool over alternatives like sign_transaction or sign_userop.

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/minhoyoo-iotrust/WAIaaS'

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