Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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, }), }, ], }; },
  • Zod schema defining empty input parameters for the get-account tool.
    parameters: z.object({}),
  • 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, }), }, ], }; }, }); };
  • 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);

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