Skip to main content
Glama

evm_sign_message

Signs arbitrary messages with an EVM private key using EIP-191 to prove address ownership for authentication and off-chain verification, without broadcasting a transaction or paying gas.

Instructions

Sign arbitrary message for authentication, verification, or proof-of-ownership (NOT a transaction).

Creates cryptographic signature of a message using private key. Used for authentication flows, message verification, and proving address ownership. Does not broadcast to blockchain.

CRITICAL RULES:

  • Signs messages, NOT transactions (no gas cost, no broadcast)

  • Signature can be verified without exposing private key

  • Standard EIP-191 message signing (\x19Ethereum Signed Message prefix)

  • Anyone can verify signature matches address (public verification)

  • Signature is deterministic (same message+key = same signature)

PARAMETERS:

  • chain: EVM chain context (required but doesn't affect signature)

    • Signature works across all chains

    • Chain parameter for consistency

  • message: Text message to sign (required)

    • Any UTF-8 text string

    • Common uses: "Sign in to {app}", "Prove ownership", timestamps

    • Example: "I approve this action at 2024-01-15T10:30:00Z"

  • privateKey: Signing key (required, KEEP SECRET)

    • Format: 0x followed by 64 hex characters

    • Must be key for address you want to prove ownership of

    • Never share or log this value

EXAMPLES: ✅ Sign authentication message: {chain: "polygon", message: "Sign in to MyApp", privateKey: "0xac0974..."}

✅ Prove ownership with timestamp: {chain: "ethereum", message: "I own this address - 2024-01-15", privateKey: "0x..."}

✅ Sign structured data: {chain: "bsc", message: "Action: transfer\nAmount: 100\nTimestamp: 1234567890", privateKey: "0x..."}

❌ Invalid - trying to sign transaction: {chain: "polygon", message: "0xf86c...", privateKey: "0x..."} // Use evm_send_transaction

❌ Invalid - wrong key format: {chain: "ethereum", message: "test", privateKey: "1234"}

SUPPORTED EVM CHAINS (7 networks): • ethereum (Sepolia) - EIP-1559 enabled, ~12s blocks, moderate gas costs • polygon (Amoy) - Low fees, fast finality (~2s), layer 2 • avalanche (Fuji C-Chain) - Sub-second finality, dynamic fees • bsc (BNB Testnet) - 3s blocks, low gas costs, Binance ecosystem • arbitrum (Sepolia) - Optimistic rollup, low fees, Ethereum security • base (Sepolia) - Coinbase layer 2, EIP-1559, low fees • worldchain (World Sepolia) - World Network testnet, EIP-1559

CRITICAL GAS CONSIDERATIONS:

  • Ethereum: High gas costs, use gas oracle for timing

  • Polygon/BSC: Very low gas, safe for frequent transactions

  • Arbitrum/Base: L2 optimizations, ~10-50x cheaper than Ethereum

  • Avalanche: Dynamic fees, can spike during congestion

  • Always check gas price before executing transactions

TESTNET TOKENS: All chains use testnet tokens with NO REAL VALUE. Faucets available for all supported networks.

OUTPUT STRUCTURE: • success: Boolean indicating signing success • message: Original message that was signed • signature: ECDSA signature (0x... 130 hex chars: r + s + v) • address: Address that created signature (derived from privateKey) • messageHash: Keccak256 hash of prefixed message • executionTime: Time taken in milliseconds

COMMON MISTAKES:

  • Trying to sign transactions (use evm_send_transaction instead)

  • Not including timestamp in message (vulnerable to replay)

  • Exposing private key accidentally

  • Not implementing signature verification on backend

  • Assuming signatures expire (they don't - add expiry in message)

USE CASES:

  • Web3 authentication (Sign-In with Ethereum)

  • Prove address ownership without transaction

  • Off-chain message verification

  • Create signed permits/approvals

  • Generate proofs for access control

SIGNATURE VERIFICATION:

  • Frontend: Use ethers.verifyMessage(message, signature)

  • Backend: Recover address from signature and compare

  • Anyone can verify signature without private key

  • Signature proves message was signed by address

SECURITY NOTES:

  • Never sign messages from untrusted sources

  • Include context in message (app name, action, timestamp)

  • Implement message expiry (include timestamp users should check)

  • Don't sign messages that look like transactions

Running on Linux.

LINUX-SPECIFIC NOTES:

  • Package manager: apt (Ubuntu/Debian), yum (RHEL/CentOS), or pacman (Arch)

  • Python 3 is typically 'python3' command

  • GNU tools are standard

  • Use 'xdg-open' command to open files/applications

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chain": "<chain>",
      "message": "<message>",
      "privateKey": "<privateKey>"
    },
    "name": "evm_sign_message"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesEVM chain context
messageYesMessage to sign (any UTF-8 text)
privateKeyYesPrivate key to sign with (0x... - KEEP SECRET)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does so well: it discloses no broadcast, no gas cost, EIP-191 prefixing, deterministic output, public verifiability, and that the private key is never exposed. However, the large "CRITICAL GAS CONSIDERATIONS" and testnet/faucet sections are irrelevant to a signing operation and could mislead an agent into thinking gas matters here, which slightly muddies the behavioral picture.

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

Conciseness2/5

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

The core signing guidance is front-loaded and clear, but it is buried under large blocks that do not belong to this tool: per-chain block times, gas strategy advice, faucet notes, and unrelated Linux/apt instructions. Every sentence should earn its place, and a substantial fraction here does not serve the signing decision.

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

Completeness4/5

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

For a 3-parameter tool with no annotations and no output schema, the definition covers inputs, behavior, and even return fields (success, signature, address, messageHash) plus verification guidance, leaving nothing essential missing. The only shortfall is that this completeness is achieved through volume that includes off-topic material rather than disciplined focus.

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

Parameters4/5

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

Schema coverage is already 100%, so the baseline is 3, but the description adds genuine meaning beyond the schema: the chain parameter is required yet does not affect the signature and works across all chains, the message may include structured newline content, and privateKey must be 0x + 64 hex for the address being proven. This is useful disambiguation rather than restatement.

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

Purpose5/5

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

The first line states a specific verb and resource ("Sign arbitrary message") and immediately scopes it against the nearest confusion ("NOT a transaction"). It repeatedly distinguishes itself from evm_send_transaction with explicit valid/invalid examples, so an agent can separate it from siblings without opening any schema.

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

Usage Guidelines5/5

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

The description gives explicit when-to-use (authentication, proof-of-ownership, off-chain verification) and when-not-to-use with a named alternative ("trying to sign transaction... Use evm_send_transaction"). It also enumerates common mistakes such as omitting timestamps or assuming signature expiry, which is actionable routing guidance.

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

Deploy Server

Other Tools