lb_account_get_subscription
Retrieve your Listing Bureau subscription details including plan label, fee, discount, and wallet usage to manage your account and track billing.
Instructions
Get Listing Bureau subscription info (plan label, fee, discount, wallet usage)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/account.tools.ts:110-129 (handler)Tool handler that GETs /api/v1/account/subscription and returns the subscription info formatted as MCP result.
server.tool( "lb_account_get_subscription", "Get Listing Bureau subscription info (plan label, fee, discount, wallet usage)", {}, { readOnlyHint: true }, async () => { try { const res = await client.request<Subscription>( "GET", "/api/v1/account/subscription", undefined, undefined, "lb_account_get_subscription", ); return formatResult(res.data); } catch (e) { return formatErrorResult(e); } }, ); - src/client/types.ts:55-60 (schema)TypeScript interface for the Subscription response shape returned by the API.
export interface Subscription { account_type: string; plan_label: string; use_wallet: boolean; subscription_fee: number; } - src/tools/account.tools.ts:7-7 (registration)Registration function called from index.ts, wraps server.tool() calls for all account tools.
export function registerAccountTools(server: McpServer, client: LBClient) { - src/index.ts:56-56 (registration)Top-level entry point where account tools (including lb_account_get_subscription) are registered.
registerAccountTools(server, client); - src/utils/response.ts:10-54 (helper)Utility that formats successful API response data into an MCP text result, extracting warnings and balance_warnings.
export function formatResult(data: unknown): CallToolResult { const warnings: string[] = []; let cleaned: Record<string, unknown> | unknown = data; if (data && typeof data === "object") { const obj = { ...(data as Record<string, unknown>) }; // Top-level warning string if ("warning" in obj && typeof obj.warning === "string") { warnings.push(obj.warning); delete obj.warning; } // balance_warning object (independent of warning) if ("balance_warning" in obj && obj.balance_warning && typeof obj.balance_warning === "object") { const bw = obj.balance_warning as Record<string, unknown>; const parts: string[] = []; if (typeof bw.warning === "string" && bw.warning.trim()) parts.push(bw.warning); if (typeof bw.daily_cost_estimate === "number") parts.push(`Daily cost estimate: $${bw.daily_cost_estimate.toFixed(2)}`); if (typeof bw.balance === "number") parts.push(`Balance: $${bw.balance.toFixed(2)}`); if (typeof bw.days_remaining === "number") parts.push(`Days remaining: ${bw.days_remaining.toFixed(1)}`); if (parts.length > 0) warnings.push(parts.join(" | ")); delete obj.balance_warning; } cleaned = obj; } let text = JSON.stringify(cleaned, null, 2); for (const w of warnings) { text += `\n\n⚠️ Warning: ${w}`; } const notice = getUpdateNotice(); if (notice) { text += `\n\n${notice}`; } return { content: [{ type: "text", text }], }; }