Skip to main content
Glama

get-account

Retrieve the current connected account details in MetaMask for secure blockchain interactions using MCPilot. Simplify user onboarding and enable AI-powered transactions without exposing private keys.

Instructions

Get current account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get-account' tool. It uses wagmi's getAccount with the wagmiConfig to fetch the current account details and returns them formatted as JSON text in the MCP response format.
    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 the input parameters for the tool (empty object, no parameters required).
    parameters: z.object({}),
  • Registers the 'get-account' tool on the FastMCP server within the registerGetAccountTools function, specifying name, description, parameters schema, and execute handler.
    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, }), }, ], } }, });
  • Invokes the registerGetAccountTools function on the main MCP server instance to add the tool.
    registerGetAccountTools(server);
  • Re-exports the get-account tool registration function from tools/index.ts for convenient import in the main index.ts.
    export * from "./get-account.js";

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/mcpilot'

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