Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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, }), }, ], }; },
  • The Zod input schema for the 'get-account' tool, which requires no parameters.
    parameters: z.object({}),
  • 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, }), }, ], }; }, });
  • Invocation of the registerGetAccountTools function as part of the overall tools registration process.
    registerGetAccountTools(server, wagmiConfig);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Xiawpohr/metamask-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server