verify-message
Confirm the authenticity of a signed message by verifying its signature against the provided Ethereum address, ensuring message integrity and origin.
Instructions
Verify that a message was signed by the provided address.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The Ethereum address that signed the original message. | |
| message | Yes | The message to be verified. | |
| signature | Yes | The signature that was generated by signing the message with the address's signer. |
Implementation Reference
- src/tools/verify-message.ts:17-27 (handler)The execute handler for the verify-message tool, which uses wagmi's verifyMessage to verify the signature and returns the address as text.execute: async (args) => { const result = await verifyMessage(wagmiConfig, args); return { content: [ { type: "text", text: result.toString(), }, ], }; },
- src/tools/verify-message.ts:12-16 (schema)Zod input schema defining address, message, and signature parameters for the tool.parameters: z.object({ address: Address.describe("The Ethereum address that signed the original message."), message: z.string().describe("The message to be verified."), signature: Signature.describe("The signature that was generated by signing the message with the address's signer."), }),
- src/tools/verify-message.ts:8-29 (registration)The registration function that adds the verify-message tool to the FastMCP server.export function registerVerifyMessageTools(server: FastMCP, wagmiConfig: Config): void { server.addTool({ name: "verify-message", description: "Verify that a message was signed by the provided address.", parameters: z.object({ address: Address.describe("The Ethereum address that signed the original message."), message: z.string().describe("The message to be verified."), signature: Signature.describe("The signature that was generated by signing the message with the address's signer."), }), execute: async (args) => { const result = await verifyMessage(wagmiConfig, args); return { content: [ { type: "text", text: result.toString(), }, ], }; }, }); };
- src/tools/register-tools.ts:55-55 (registration)Invocation of the verify-message tool registration during overall tools setup.registerVerifyMessageTools(server, wagmiConfig);
- src/utils/evm-schema.ts:20-27 (helper)Helper Zod schema for validating EVM signatures used in verify-message tool.const regex = /^0x[a-fA-F0-9]+$/; if (!regex.test(val)) { ctx.addIssue({ code: z.ZodIssueCode.custom, message: `Invalid calldata ${val}`, }); }