Skip to main content
Glama
sign-message.ts908 B
import { FastMCP } from "fastmcp"; import { z } from "zod"; import { signMessage } from "@wagmi/core" import { wagmiConfig } from "../wagmi-config.js"; import { JSONStringify } from "../utils/json-stringify.js"; 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; } }, }); };

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