get_account
Retrieve account details including wallet address, domain count, and total spending from the Bloomfilter domain management service.
Instructions
Get account information — wallet address, domain count, total spent.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/account.ts:12-36 (handler)The main getAccount handler function that retrieves account information via GET /account API endpoint. It requires authentication (JWT), fetches wallet address, domain count, total spent, and account timestamps, then formats the response for MCP output.
export async function getAccount(client: BloomfilterClient): Promise<McpToolResult> { const keyError = client.requiresPrivateKey(); if (keyError) return keyError; try { await client.ensureAuth(); const { data } = await client.http.get<AccountResponse>("/account", { headers: client.getAuthHeaders(), }); const text = [ "Account Information:", ` Wallet: ${data.wallet_address}`, ` Domains: ${data.domains_registered}`, ` Total Spent: $${(data.total_spent_cents / 100).toFixed(2)}`, ` Member Since: ${data.created_at}`, ` Last Active: ${data.last_active_at}`, ].join("\n"); return { content: [{ type: "text", text }] }; } catch (error) { return formatToolError(error); } } - src/types.ts:124-130 (schema)AccountResponse interface defining the structure of the API response including wallet_address, created_at, total_spent_cents, domains_registered, and last_active_at fields.
export interface AccountResponse { wallet_address: string; created_at: string; total_spent_cents: number; domains_registered: number; last_active_at: string; } - src/index.ts:225-231 (registration)Registration of the get_account tool with the MCP server. Tool has no input parameters (empty schema) and maps to the getAccount handler function.
// 10. get_account server.tool( "get_account", "Get account information — wallet address, domain count, total spent.", {}, async () => getAccount(client), );