Skip to main content
Glama
listingbureau

Listing Bureau - Amazon Organic Ranking

lb_account_get

Read-only

Retrieve your Listing Bureau account details including email, name, status, and wallet balance to manage your Amazon organic ranking campaigns.

Instructions

Get Listing Bureau account info (email, name, account status, wallet balance)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that registers the 'lb_account_get' tool. It calls two API endpoints (/api/v1/account and /api/v1/wallet) in parallel, derives an account status (Active/Inactive/No funds), and returns a combined result with email, name, account_status, and wallet_balance.
    export function registerAccountTools(server: McpServer, client: LBClient) {
      server.tool(
        "lb_account_get",
        "Get Listing Bureau account info (email, name, account status, wallet balance)",
        {},
        { readOnlyHint: true  },
        async () => {
          try {
            const [accountRes, walletRes] = await Promise.all([
              client.request<Account>("GET", "/api/v1/account", undefined, undefined, "lb_account_get"),
              client.request<WalletBalance>("GET", "/api/v1/wallet", undefined, undefined, "lb_account_get"),
            ]);
    
            const account = accountRes.data;
            const wallet = walletRes.data;
    
            // Derive display status
            let status: string;
            let note: string | undefined;
            if (account.account_status === "inactive") {
              status = "Inactive";
              note = "Account disabled. Contact hello@listingbureau.com";
            } else if ((wallet.balance_usd - wallet.held_usd) < 1) {
              status = "No funds";
            } else {
              status = "Active";
            }
    
            const result: Record<string, unknown> = {
              email: account.email,
              name: `${account.first_name} ${account.last_name}`.trim(),
              account_status: status,
              wallet_balance: {
                balance_usd: wallet.balance_usd,
                held_usd: wallet.held_usd,
              },
            };
            if (note) result.note = note;
    
            return formatResult(result);
          } catch (e) {
            return formatErrorResult(e);
          }
        },
      );
  • Registration of 'lb_account_get' via server.tool() inside registerAccountTools(), which is called from src/index.ts:56.
    export function registerAccountTools(server: McpServer, client: LBClient) {
      server.tool(
        "lb_account_get",
        "Get Listing Bureau account info (email, name, account status, wallet balance)",
        {},
        { readOnlyHint: true  },
        async () => {
          try {
            const [accountRes, walletRes] = await Promise.all([
              client.request<Account>("GET", "/api/v1/account", undefined, undefined, "lb_account_get"),
              client.request<WalletBalance>("GET", "/api/v1/wallet", undefined, undefined, "lb_account_get"),
            ]);
    
            const account = accountRes.data;
            const wallet = walletRes.data;
    
            // Derive display status
            let status: string;
            let note: string | undefined;
            if (account.account_status === "inactive") {
              status = "Inactive";
              note = "Account disabled. Contact hello@listingbureau.com";
            } else if ((wallet.balance_usd - wallet.held_usd) < 1) {
              status = "No funds";
            } else {
              status = "Active";
            }
    
            const result: Record<string, unknown> = {
              email: account.email,
              name: `${account.first_name} ${account.last_name}`.trim(),
              account_status: status,
              wallet_balance: {
                balance_usd: wallet.balance_usd,
                held_usd: wallet.held_usd,
              },
            };
            if (note) result.note = note;
    
            return formatResult(result);
          } catch (e) {
            return formatErrorResult(e);
          }
        },
      );
  • formatResult() helper used by the handler to format successful API responses as MCP CallToolResult.
    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 }],
      };
    }
  • formatErrorResult() helper used by the handler to format errors as MCP error results.
    export function formatErrorResult(error: unknown): CallToolResult {
      return {
        content: [{ type: "text", text: formatError(error) }],
        isError: true,
      };
    }
  • Type definitions for Account and WalletBalance interfaces used by the tool handler.
    export interface Account {
      email: string;
      first_name: string;
      last_name: string;
      account_status: string;  // "active" | "inactive"
    }
    
    export interface Subscription {
      account_type: string;
      plan_label: string;
      use_wallet: boolean;
      subscription_fee: number;
    }
    
    export interface ServiceRates {
      atc: number;
      pgv: number;
      sfb_service_fee: number;
      sfb_fee_rate: number;
      sfb_formula: string;
      sfb_description: string;
      sfb_lock_days: number;
      server_date: string;
      [key: string]: unknown;
    }
    
    export interface BalanceWarning {
      warning: string;
      daily_cost_estimate: number;
      balance?: number;
      days_remaining?: number;
    }
    
    export interface CostSummary {
      total_estimated_cost: number | null;
      avg_daily_cost: number;
      num_scheduled_days: number | null;
      note: string;
    }
    
    // -- Wallet -------------------------------------------------------------------
    
    export interface WalletBalance {
      balance_usd: number;
      held_usd: number;
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description complements the readOnlyHint annotation by specifying the exact data returned (email, name, account status, wallet balance). No contradictions are present. However, it does not disclose any potential side effects, rate limits, or authorization details beyond the annotation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that effectively conveys the tool's purpose and key return fields. No extraneous text is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters and a straightforward read-only purpose, the description sufficiently indicates what data will be returned. However, it could be slightly more complete by clarifying that the info is for the authenticated user's account, though this is implied.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters, and the description adds no parameter information, which is acceptable as baseline 4 for zero-parameter tools. The description's mention of returned fields does not relate to parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly specifies the verb 'Get' and the resource 'Listing Bureau account info', listing the specific fields (email, name, account status, wallet balance). This effectively distinguishes it from sibling tools like lb_account_get_service_rates and lb_account_get_subscription which focus on subsets of account data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as lb_wallet_get_balance (which also returns wallet balance) or lb_account_get_subscription. It does not mention any prerequisites, authentication requirements, or exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/listingbureau/listingbureau-mcp'

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