get-chains
Retrieve configured blockchain chains on MCPilot, enabling secure AI-driven interactions with MetaMask for simplified user onboarding.
Instructions
Get the configured chains
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The execute handler for the "get-chains" tool. It calls getChains from @wagmi/core using the wagmiConfig and returns the result as a text content block with JSONStringify.execute: async () => { const result = getChains(wagmiConfig) return { content: [ { type: "text", text: JSONStringify(result), }, ], } },
- Zod schema for the tool parameters: an empty object since the tool takes no input.parameters: z.object({}),
- packages/metamask-mcp/src/tools/get-chains.ts:8-23 (registration)Registers the "get-chains" tool on the FastMCP server within the registerGetChainsTools function.server.addTool({ name: "get-chains", description: "Get the configured chains", parameters: z.object({}), execute: async () => { const result = getChains(wagmiConfig) return { content: [ { type: "text", text: JSONStringify(result), }, ], } }, });
- packages/metamask-mcp/src/index.ts:48-48 (registration)Invokes the registerGetChainsTools function to add the tool to the main MCP server instance.registerGetChainsTools(server);