Skip to main content
Glama

list_products

List products in a catalog by providing catalog ID. Optionally filter results, paginate, and specify fields to return.

Instructions

List products within a catalog.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
catalog_idYesProduct catalog ID
fieldsNoComma-separated fields to return
limitNoNumber of results to return
afterNoPagination cursor for next page
filterNoJSON string of filter rules

Implementation Reference

  • The handler function for list_products tool that calls the API to list products within a catalog.
    async ({ catalog_id, ...params }) => {
      try {
        const { data, rateLimit } = await client.get(`/${catalog_id}/products`, { ...params });
        return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
      } catch (error) {
        return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
      }
    }
  • Input schema for list_products: catalog_id (required), fields, limit, after, filter (optional).
    {
      catalog_id: z.string().describe("Product catalog ID"),
      fields: z.string().optional().describe("Comma-separated fields to return"),
      limit: z.number().optional().default(25).describe("Number of results to return"),
      after: z.string().optional().describe("Pagination cursor for next page"),
      filter: z.string().optional().describe("JSON string of filter rules"),
    },
  • Registration of the list_products tool via server.tool() call, with description 'List products within a catalog.'
    // ─── list_products ─────────────────────────────────────────
    server.tool(
      "list_products",
      "List products within a catalog.",
      {
        catalog_id: z.string().describe("Product catalog ID"),
        fields: z.string().optional().describe("Comma-separated fields to return"),
        limit: z.number().optional().default(25).describe("Number of results to return"),
        after: z.string().optional().describe("Pagination cursor for next page"),
        filter: z.string().optional().describe("JSON string of filter rules"),
      },
      async ({ catalog_id, ...params }) => {
        try {
          const { data, rateLimit } = await client.get(`/${catalog_id}/products`, { ...params });
          return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
  • The registerCatalogTools function that registers all catalog tools including list_products on the MCP server.
    export function registerCatalogTools(server: McpServer, client: AdsClient): void {
  • src/index.ts:71-71 (registration)
    Call site where registerCatalogTools is invoked to register list_products on the main server.
    registerCatalogTools(server, client);
Behavior2/5

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

With no annotations, the description fails to disclose behavioral traits like pagination (cursor-based), default limit, filtering behavior, or idempotency. The schema hints at these but the description adds no context.

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

Conciseness4/5

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

The description is very concise (5 words) and front-loaded, but it sacrifices useful structure; a sentence or two on key capabilities would improve it without being verbose.

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?

Given 5 parameters, no output schema, and no annotations, the description is inadequate. It omits return format, default behavior, pagination info, and error handling, leaving the agent to infer from the schema alone.

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%, so baseline 3 applies. The description adds no additional meaning beyond parameter names; e.g., 'fields' is self-explanatory but filter and pagination details are absent.

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 the action (list) and resource (products) with a scope (within a catalog), effectively distinguishing from sibling tools like list_catalogs or list_ads.

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 is provided on when to use this tool versus alternatives such as search_product or get_product_set, leaving the agent without decision support.

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/mikusnuz/meta-ads-mcp'

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