get-account
Retrieve the currently active Ethereum account from MetaMask, enabling secure interaction with blockchain applications without exposing private keys.
Instructions
Get the current account.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/get-account.ts:12-27 (handler)The execute handler for the 'get-account' tool, which calls wagmi's getAccount and returns the account details as structured text content.execute: async () => { const result = getAccount(wagmiConfig); return { content: [ { type: "text", text: JSONStringify({ address: result.address, addresses: result.addresses, chainId: result.chainId, status: result.status, }), }, ], }; },
- src/tools/get-account.ts:11-11 (schema)The Zod input schema for the 'get-account' tool, which requires no parameters.parameters: z.object({}),
- src/tools/get-account.ts:8-28 (registration)The registration of the 'get-account' tool via server.addTool, including name, description, parameters schema, and execute handler.server.addTool({ name: "get-account", description: "Get the 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, }), }, ], }; }, });
- src/tools/register-tools.ts:40-40 (registration)Invocation of the registerGetAccountTools function as part of the overall tools registration process.registerGetAccountTools(server, wagmiConfig);