Skip to main content
Glama
listingbureau

Listing Bureau - Amazon Organic Ranking

lb_wallet_topup

Destructive

Generate a Stripe checkout URL to add funds to your wallet. Requires a top-up amount between $5 and $5,000.

Instructions

Generate a Stripe checkout URL to top up wallet balance. Returns a URL to complete payment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesTop-up amount in USD (minimum $5, maximum $5,000)

Implementation Reference

  • Handler for lb_wallet_topup tool. Sends a POST request to /api/v1/wallet/topup with the amount, returns a TopupResponse containing a Stripe checkout URL.
    server.tool(
      "lb_wallet_topup",
      "Generate a Stripe checkout URL to top up wallet balance. Returns a URL to complete payment.",
      {
        amount: z
          .number()
          .min(5)
          .max(5000)
          .describe("Top-up amount in USD (minimum $5, maximum $5,000)"),
      },
      { destructiveHint: true },
      async (params) => {
        try {
          const res = await client.request<TopupResponse>(
            "POST",
            "/api/v1/wallet/topup",
            { amount: params.amount },
            undefined,
            "lb_wallet_topup",
          );
          return formatResult(res.data);
        } catch (e) {
          return formatErrorResult(e);
        }
      },
    );
  • Response type returned by the topup endpoint — contains a Stripe checkout URL.
    export interface TopupResponse {
      checkout_url: string;
    }
  • Registration of lb_wallet_topup via server.tool() inside the registerWalletTools function, called from src/index.ts line 57.
    export function registerWalletTools(server: McpServer, client: LBClient) {
      server.tool(
        "lb_wallet_get_balance",
        "Get Listing Bureau wallet balance (credits and USD). May include a warning if data is temporarily unavailable.",
        {},
        { readOnlyHint: true  },
        async () => {
          try {
            const res = await client.request<WalletBalance>(
              "GET",
              "/api/v1/wallet",
              undefined,
              undefined,
              "lb_wallet_get_balance",
            );
            return formatResult(res.data);
          } catch (e) {
            return formatErrorResult(e);
          }
        },
      );
    
      server.tool(
        "lb_wallet_get_transactions",
        "Get Listing Bureau wallet transaction history (paginated). Last page may include legacy entries beyond per_page count.",
        {
          page: z.number().int().min(1).optional().describe("Page number (default 1)"),
          per_page: z
            .number()
            .int()
            .min(1)
            .max(100)
            .optional()
            .describe("Results per page (default 50, max 100)"),
        },
        { readOnlyHint: true  },
        async (params) => {
          try {
            const query: Record<string, string> = {};
            if (params.page !== undefined) query.page = String(params.page);
            if (params.per_page !== undefined)
              query.per_page = String(params.per_page);
            const res = await client.request<Transaction[]>(
              "GET",
              "/api/v1/wallet/transactions",
              undefined,
              query,
              "lb_wallet_get_transactions",
            );
            if (res.meta) {
              return formatPaginatedResult(res.data, res.meta);
            }
            return formatResult(res.data);
          } catch (e) {
            return formatErrorResult(e);
          }
        },
      );
    
      server.tool(
        "lb_wallet_topup",
        "Generate a Stripe checkout URL to top up wallet balance. Returns a URL to complete payment.",
        {
          amount: z
            .number()
            .min(5)
            .max(5000)
            .describe("Top-up amount in USD (minimum $5, maximum $5,000)"),
        },
        { destructiveHint: true },
        async (params) => {
          try {
            const res = await client.request<TopupResponse>(
              "POST",
              "/api/v1/wallet/topup",
              { amount: params.amount },
              undefined,
              "lb_wallet_topup",
            );
            return formatResult(res.data);
          } catch (e) {
            return formatErrorResult(e);
          }
        },
      );
    }
  • src/index.ts:57-57 (registration)
    Entry point where registerWalletTools is invoked, making all wallet tools (including lb_wallet_topup) available on the MCP server.
    registerWalletTools(server, client);
  • Helper used to format the successful API response into an 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;
Behavior2/5

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

Description says 'generate URL' which is read-only, but annotation destructiveHint suggests mutation. No clarification that actual balance change occurs later via Stripe. Minimal behavioral context beyond annotations.

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?

Two concise sentences with no wasted words. Front-loaded with action and outcome.

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?

Adequate for a simple tool with one parameter. States purpose and return value. Could mention that it does not directly modify balance.

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

Parameters3/5

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

Schema already describes the amount parameter with min/max. Description adds no further semantic value, but schema coverage is 100%, so baseline score applies.

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?

Clearly states it generates a Stripe checkout URL for wallet top-up and returns a URL. Distinguished from sibling read tools like lb_wallet_get_balance.

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

Usage Guidelines3/5

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

Implies usage when needing to add funds, but no explicit when-to-use or alternatives. Lacks guidance on prerequisites or context.

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