Skip to main content
Glama
listingbureau

Listing Bureau - Amazon Organic Ranking

lb_orders_list

Read-only

Retrieve a paginated list of Amazon organic ranking orders, sorted newest first. View order status, campaign details, region, and issue report status for each order.

Instructions

List Listing Bureau orders (paginated, newest first). Includes order status, campaign, region, and issue report status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (default 1)
per_pageNoResults per page (default 50, max 100)

Implementation Reference

  • The handler function for the lb_orders_list tool. It builds query params from page/per_page inputs, makes a GET request to /api/v1/orders, and formats the paginated result.
    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<Order[]>(
          "GET",
          "/api/v1/orders",
          undefined,
          query,
          "lb_orders_list",
        );
        if (res.meta) {
          return formatPaginatedResult(res.data, res.meta);
        }
        return formatResult(res.data);
      } catch (e) {
        return formatErrorResult(e);
      }
    },
  • Input schema for lb_orders_list using Zod: optional 'page' (int >=1) and 'per_page' (int 1-100) parameters.
    {
      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)"),
    },
  • Registration function registerOrdersTools that registers the tool on the MCP server via server.tool().
    export function registerOrdersTools(server: McpServer, client: LBClient) {
      server.tool(
        "lb_orders_list",
  • formatPaginatedResult helper - formats the paginated API response with data and pagination metadata.
    export function formatPaginatedResult(
      data: unknown,
      meta: { page: number; per_page: number; total: number; total_pages: number },
    ): CallToolResult {
      const result = {
        data,
        pagination: meta,
      };
      let text = JSON.stringify(result, null, 2);
    
      const notice = getUpdateNotice();
      if (notice) {
        text += `\n\n${notice}`;
      }
    
      return {
        content: [{ type: "text", text }],
      };
    }
  • The LBClient.request() method handles authenticated API requests, including 401 retry logic. The tool passes 'lb_orders_list' as the toolName for identification.
    async request<T>(
      method: string,
      path: string,
      body?: Record<string, unknown>,
      query?: Record<string, string>,
      toolName?: string,
    ): Promise<ApiSuccessResponse<T>> {
      await this.ensureAuth();
      const response = await this.doRequest<T>(method, path, body, query, toolName);
    
      // Single retry on 401
      if (response.status === "error" && response._statusCode === 401) {
        this.jwt = null;
        await this.ensureAuth();
        const retry = await this.doRequest<T>(method, path, body, query, toolName);
        if (retry.status === "error") {
          throw new LBApiError(
            retry._statusCode ?? 500,
            retry.error.code,
            retry.error.message,
          );
        }
        return retry as ApiSuccessResponse<T>;
      }
    
      if (response.status === "error") {
        throw new LBApiError(
          response._statusCode ?? 500,
          response.error.code,
          response.error.message,
        );
      }
    
      return response as ApiSuccessResponse<T>;
    }
    
    private async doRequest<T>(
      method: string,
      path: string,
      body?: Record<string, unknown>,
      query?: Record<string, string>,
      toolName?: string,
    ): Promise<ApiResponse<T> & { _statusCode?: number }> {
      let url = `${this.baseUrl}${path}`;
      if (query) {
        const params = new URLSearchParams(
          Object.entries(query).filter(([, v]) => v !== undefined && v !== ""),
        );
        const qs = params.toString();
        if (qs) url += `?${qs}`;
      }
    
      const headers: Record<string, string> = {
        Authorization: `Bearer ${this.jwt!.access_token}`,
        "X-LB-Source": "mcp",
        ...(toolName && { "X-LB-Tool": toolName }),
      };
    
      const options: RequestInit = { method, headers };
      if (body && method !== "GET") {
        headers["Content-Type"] = "application/json";
        options.body = JSON.stringify(body);
      }
    
      const res = await fetch(url, options);
    
      // Note: non-JSON responses (e.g., gateway 502/401) throw here and bypass
      // the 401-retry path in request(). This is acceptable -- gateway-level 401s
      // are not recoverable via token refresh anyway.
      let json: ApiResponse<T>;
      try {
        json = (await res.json()) as ApiResponse<T>;
      } catch {
        throw new LBApiError(
          res.status,
          "PARSE_ERROR",
          `Server returned non-JSON response (HTTP ${res.status})`,
        );
      }
    
      // Attach status code for retry logic
      return { ...json, _statusCode: res.status };
    }
Behavior4/5

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

Annotations already set readOnlyHint=true, so the description adds value by detailing returned fields and pagination behavior. It does not contradict annotations and provides useful context beyond safety guarantees.

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?

Single sentence that is short, front-loaded with action and resource, and contains no unnecessary words. Every part conveys essential information efficiently.

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

Completeness5/5

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

For a simple list tool with pagination and no output schema, the description covers purpose, ordering, and key returned fields. No obvious gaps given the low complexity and adequate annotations.

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?

Input schema has 100% coverage with descriptions for both page and per_page. The description does not add additional parameter meaning beyond what the schema already provides, so baseline score of 3 is appropriate.

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 states it lists orders with pagination and newest-first ordering, and specifies included fields like status, campaign, region, issue report status. This distinguishes it from sibling tools like lb_orders_get (single order) and lb_orders_report_issue (issue submission).

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?

The description implies pagination and ordering but does not explicitly state when to use this tool over alternatives (e.g., get for a specific order). No when-not-to-use guidance or alternative tool names are mentioned.

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