Skip to main content
Glama

list_products

Retrieve product listings with filters for status, category, name, and includes. Supports pagination and sorting.

Instructions

List products. GET /products. Optional: include (productRateplan, productRateplanCharge, chargeTier), status (published|draft|archived|disabled), name, category (baseProducts|addOn|bundleProduct|miscellaneous|service), orderBy, sortBy (ASC/DESC), itemPerPage, pageNo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeNoComma-separated includes: productRateplan, productRateplanCharge, chargeTier
statusNoFilter by product status
nameNoFilter by product name
categoryNoFilter by product category
orderByNoSort column
sortByNoASC or DESC
itemPerPageNoItems per page
pageNoNoPage number (1-based)

Implementation Reference

  • Export of the list_products tool. The handler function (lines 51-57) validates args with Zod schema, then calls productService.listProducts(client, parsed.data).
    export const listProductsTool: Tool = {
      definition,
      handler,
    };
  • The actual handler function for list_products: validates input against Zod schema, calls the underlying service function, and wraps the result.
    async function handler(client: Client, args: Record<string, unknown> | undefined) {
      const parsed = schema.safeParse(args);
      if (!parsed.success) {
        return errorResult(parsed.error.errors.map((e) => e.message).join("; "));
      }
      return handleToolCall(() => productService.listProducts(client, parsed.data));
    }
  • Zod validation schema for list_products input parameters.
    const schema = z.object({
      include: z.string().optional(),
      status: z.enum(["published", "draft", "archived", "disabled"]).optional(),
      name: z.string().optional(),
      category: z
        .enum(["baseProducts", "addOn", "bundleProduct", "miscellaneous", "service"])
        .optional(),
      orderBy: z.string().optional(),
      sortBy: z.enum(["ASC", "DESC"]).optional(),
      itemPerPage: z.number().int().min(1).optional(),
      pageNo: z.number().int().min(1).optional(),
    });
  • MCP tool definition for list_products: name, description, and JSON Schema input schema.
    const definition = {
      name: "list_products",
      description:
        "List products. GET /products. Optional: include (productRateplan, productRateplanCharge, chargeTier), status (published|draft|archived|disabled), name, category (baseProducts|addOn|bundleProduct|miscellaneous|service), orderBy, sortBy (ASC/DESC), itemPerPage, pageNo.",
      inputSchema: {
        type: "object" as const,
        properties: {
          include: {
            type: "string",
            description: "Comma-separated includes: productRateplan, productRateplanCharge, chargeTier",
          },
          status: {
            type: "string",
            enum: ["published", "draft", "archived", "disabled"],
            description: "Filter by product status",
          },
          name: { type: "string", description: "Filter by product name" },
          category: {
            type: "string",
            enum: ["baseProducts", "addOn", "bundleProduct", "miscellaneous", "service"],
            description: "Filter by product category",
          },
          orderBy: { type: "string", description: "Sort column" },
          sortBy: { type: "string", description: "ASC or DESC" },
          itemPerPage: { type: "number", description: "Items per page" },
          pageNo: { type: "number", description: "Page number (1-based)" },
        },
        required: [],
      },
    };
  • The actual API call for list_products: builds query parameters from optional filters and performs a GET /products request.
    export async function listProducts(
      client: Client,
      params?: ListProductsParams
    ): Promise<PaginatedResponse<unknown>> {
      const search = new URLSearchParams();
      if (params?.include) search.append("include", params.include);
      if (params?.status) search.append("status", params.status);
      if (params?.name) search.append("name", params.name);
      if (params?.category) search.append("category", params.category);
      if (params?.orderBy) search.append("orderBy", params.orderBy);
      if (params?.sortBy) search.append("sortBy", params.sortBy);
      if (params?.itemPerPage != null) search.append("itemPerPage", String(params.itemPerPage));
      if (params?.pageNo != null) search.append("pageNo", String(params.pageNo));
      if (params?.filterId != null) search.append("filterId", String(params.filterId));
      if (params?.query) search.append("query", params.query);
      const q = search.toString();
      return client.get<PaginatedResponse<unknown>>(`/products${q ? `?${q}` : ""}`);
    }
Behavior2/5

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

No annotations provided, so description must disclose behavior. It only lists parameters without explaining pagination behavior, default values, or response structure. The description fails to clarify that this is a read-only operation (implied by GET) but does not mention rate limits or other constraints.

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

Conciseness3/5

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

Description is a single sentence with a list, which is concise but not well-structured. The main verb and resource are front-loaded, but the parameter list is dense and could be formatted for clarity. No unnecessary information, but also no extra value.

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

Completeness2/5

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

No output schema and description does not explain return format or pagination details despite having pagination parameters. Fails to provide sufficient context for a list endpoint with 8 optional parameters. The description is incomplete for effective use.

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 coverage is 100% with descriptions for all parameters. Description adds marginal value by listing parameter names with enum values in parentheses, but does not provide deeper semantics beyond what schema already offers. Baseline 3 is appropriate.

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

Purpose4/5

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

Clearly states 'List products' and references GET /products, specifying verb and resource. However, does not explicitly distinguish from sibling list tools like list_product_rate_plans, but the resource 'products' is distinct.

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?

No guidance on when to use this tool versus alternatives. It lists parameters but does not provide context for selecting this tool over list_product_rate_plans or get_product. No usage conditions or exclusions 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/rhinosaas/rebillia-mcp-server'

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