get-account
Retrieve the currently active MetaMask wallet address to enable blockchain interactions and transaction signing while keeping private keys secure in your wallet.
Instructions
Get the current account.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/get-account.ts:12-27 (handler)The handler function that executes the tool logic: retrieves the current account using Wagmi's getAccount and returns a structured text response with 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, }), }, ], }; }, - src/tools/get-account.ts:11-11 (schema)Zod schema defining empty input parameters for the get-account tool.
parameters: z.object({}), - src/tools/get-account.ts:7-29 (registration)Registers the get-account tool on the FastMCP server, defining name, description, schema, and handler.
export function registerGetAccountTools(server: FastMCP, wagmiConfig: Config): void { 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)Calls the registerGetAccountTools function as part of registering all tools.
registerGetAccountTools(server, wagmiConfig); - src/index.ts:15-15 (registration)Top-level call to registerTools which includes get-account tool registration.
registerTools(server, wagmiConfig);