get-chains
Retrieve configured blockchain networks for secure AI-powered interactions through MetaMask wallet without exposing private keys.
Instructions
Get the configured chains
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get-chains"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The execute handler for the 'get-chains' tool. It retrieves configured chains using wagmi's getChains function with the wagmiConfig and returns the JSON-stringified result as text content.
execute: async () => { const result = getChains(wagmiConfig) return { content: [ { type: "text", text: JSONStringify(result), }, ], } }, - Zod schema defining the input parameters for the 'get-chains' tool (empty object, no parameters).
parameters: z.object({}), - packages/metamask-mcp/src/tools/get-chains.ts:7-24 (registration)The registerGetChainsTools function that defines and registers the 'get-chains' MCP tool with the FastMCP server, including name, description, schema, and handler.
export function registerGetChainsTools(server: FastMCP): void { 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)The call to registerGetChainsTools during server initialization, importing all tool registrations from './tools/index.js'.
registerGetChainsTools(server);