get_account
Get account information from Bloomfilter: wallet address, domain count, and total spent.
Instructions
Get account information — wallet address, domain count, total spent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/account.ts:12-36 (handler)The getAccount function that executes the tool logic. It authenticates, calls GET /account, and formats the response.
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 shape of the API response used by get_account.
export interface AccountResponse { wallet_address: string; created_at: string; total_spent_cents: number; domains_registered: number; last_active_at: string; } - src/index.ts:226-231 (registration)Registration of the 'get_account' tool with the MCP server, linking the name to the getAccount handler.
server.tool( "get_account", "Get account information — wallet address, domain count, total spent.", {}, async () => getAccount(client), );