get-account
Retrieve the current connected account details in MetaMask for secure blockchain interactions using MCPilot. Simplify user onboarding and enable AI-powered transactions without exposing private keys.
Instructions
Get current account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function for the 'get-account' tool. It uses wagmi's getAccount with the wagmiConfig to fetch the current account details and returns them formatted as JSON text in the MCP response format.execute: async () => { const result = getAccount(wagmiConfig) return { content: [ { type: "text", text: JSONStringify({ address: result.address, addresses: result.addresses, chainId: result.chainId, status: result.status, }), }, ], } },
- Zod schema defining the input parameters for the tool (empty object, no parameters required).parameters: z.object({}),
- packages/metamask-mcp/src/tools/get-account.ts:8-28 (registration)Registers the 'get-account' tool on the FastMCP server within the registerGetAccountTools function, specifying name, description, parameters schema, and execute handler.server.addTool({ name: "get-account", description: "Get current account", parameters: z.object({}), execute: async () => { const result = getAccount(wagmiConfig) return { content: [ { type: "text", text: JSONStringify({ address: result.address, addresses: result.addresses, chainId: result.chainId, status: result.status, }), }, ], } }, });
- packages/metamask-mcp/src/index.ts:43-43 (registration)Invokes the registerGetAccountTools function on the main MCP server instance to add the tool.registerGetAccountTools(server);
- Re-exports the get-account tool registration function from tools/index.ts for convenient import in the main index.ts.export * from "./get-account.js";