Skip to main content
Glama

get_catalog_products

Read-onlyIdempotent

Retrieve catalog products with filtering by category, search, and product type. Supports pagination and sorting to manage large result sets.

Instructions

Get all catalog products

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoCursor for fetching the next page of results
per_pageNoNumber of results per page (default: 25)
publishedNoShow only published products
category_idNoFilter results on category_id
productable_typeNoFilter results on productable_type
searchNoFilter results on search
sortNoSort the results. Can change order by using `<sort_by>:<direction>` where `<direction>` is either `asc` or `desc`

Implementation Reference

  • The async handler function for the 'get_catalog_products' tool. Calls apiList('/catalog/products', ...), logs the response, formats the result using formatList, and appends a next-cursor hint if paginated.
    async ({ cursor, per_page, published, category_id, productable_type, search, sort }) => {
      try {
        const result = await apiList<EduframeRecord>("/catalog/products", {
          cursor,
          per_page,
          published,
          category_id,
          productable_type,
          search,
          sort,
        });
        void logResponse(
          "get_catalog_products",
          { cursor, per_page, published, category_id, productable_type, search, sort },
          result,
        );
        const toolResult = formatList(result.records, "catalog products");
        if (result.nextCursor) {
          toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
        }
        return toolResult;
      } catch (error) {
        return formatError(error);
      }
    },
  • Input schema for 'get_catalog_products' with filter parameters: cursor, per_page, published, category_id, productable_type, search, and sort.
    {
      description: "Get all catalog products",
      annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
      inputSchema: {
        cursor: z.string().optional().describe("Cursor for fetching the next page of results"),
        per_page: z.number().int().positive().optional().describe("Number of results per page (default: 25)"),
        published: z.enum(["published"]).optional().describe("Show only published products"),
        category_id: z.number().int().optional().describe("Filter results on category_id"),
        productable_type: z
          .enum(["Course", "Program::Program"])
          .optional()
          .describe("Filter results on productable_type"),
        search: z.string().optional().describe("Filter results on search"),
        sort: z
          .array(z.enum(["id:asc", "id:desc", "position:asc", "position:desc"]))
          .optional()
          .describe(
            "Sort the results. Can change order by using `<sort_by>:<direction>` where `<direction>` is either `asc` or `desc`",
          ),
      },
  • Registration of the 'get_catalog_products' tool via server.registerTool() with its schema, annotations, and handler.
    server.registerTool(
      "get_catalog_products",
      {
        description: "Get all catalog products",
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          cursor: z.string().optional().describe("Cursor for fetching the next page of results"),
          per_page: z.number().int().positive().optional().describe("Number of results per page (default: 25)"),
          published: z.enum(["published"]).optional().describe("Show only published products"),
          category_id: z.number().int().optional().describe("Filter results on category_id"),
          productable_type: z
            .enum(["Course", "Program::Program"])
            .optional()
            .describe("Filter results on productable_type"),
          search: z.string().optional().describe("Filter results on search"),
          sort: z
            .array(z.enum(["id:asc", "id:desc", "position:asc", "position:desc"]))
            .optional()
            .describe(
              "Sort the results. Can change order by using `<sort_by>:<direction>` where `<direction>` is either `asc` or `desc`",
            ),
        },
      },
      async ({ cursor, per_page, published, category_id, productable_type, search, sort }) => {
        try {
          const result = await apiList<EduframeRecord>("/catalog/products", {
            cursor,
            per_page,
            published,
            category_id,
            productable_type,
            search,
            sort,
          });
          void logResponse(
            "get_catalog_products",
            { cursor, per_page, published, category_id, productable_type, search, sort },
            result,
          );
          const toolResult = formatList(result.records, "catalog products");
          if (result.nextCursor) {
            toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
          }
          return toolResult;
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • The registerCatalogProductTools function is called from the central tools index to register all catalog product tools (including get_catalog_products).
    registerCatalogProductTools,
  • The apiList helper function that performs the actual GET request to the paginated list endpoint (used by the handler).
    export async function apiList<T>(path: string, query?: Record<string, QueryValue>): Promise<ListResult<T>> {
      const { token } = getConfig();
      const url = buildUrl(path, query);
    
      const response = await fetch(url.toString(), {
        method: "GET",
        headers: buildHeaders(token),
      });
    
      await checkResponse(response);
    
      const records = (await response.json()) as T[];
      const nextCursor = parseNextCursor(response.headers.get("Link"));
    
      return { records, nextCursor };
    }
Behavior2/5

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

Annotations already indicate read-only and idempotent behavior. The description adds no extra behavioral context such as pagination details, default sorting, or rate limits.

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 a single concise sentence with no wasted words. It could potentially be expanded with more context without becoming 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 the tool has 7 parameters and no output schema, the description is too sparse. It fails to explain typical usage, pagination behavior, or how to combine filters.

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 covers all 7 parameters with descriptions (100% coverage). The description adds no additional meaning beyond the schema, so baseline score 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?

The description clearly states it retrieves all catalog products, which distinguishes it from the sibling 'get_catalog_product' (singular). However, it could be slightly more explicit about returning a list.

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 like 'get_catalog_product' or other listing tools. No mention of typical use cases or exclusions.

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/martijnpieters/eduframe-mcp'

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