get-account
Retrieve the current blockchain account address from MetaMask wallet for secure AI-powered transactions and interactions.
Instructions
Get current account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The execute handler for the 'get-account' tool. Retrieves the current account information using wagmi's getAccount function with the configured wagmiConfig and returns a formatted text response containing address, addresses, chainId, and status.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/tools/get-account.ts:7-29 (registration)The registration function for the 'get-account' tool. Adds the tool to the FastMCP server, specifying name, description, empty input schema (z.object({})), and the execute handler.export function registerGetAccountTools(server: FastMCP): void { 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)Top-level call to register the 'get-account' tool on the main FastMCP server instance.registerGetAccountTools(server);