Skip to main content
Glama

create_product_set

Create a product set within a catalog by providing a name and optional JSON filter rules to organize products.

Instructions

Create a new product set within a catalog.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
catalog_idYesProduct catalog ID
nameYesProduct set name
filterNoJSON string of filter rules for the product set

Implementation Reference

  • The handler function that creates a new product set by POSTing to /{catalog_id}/product_sets with name and optional filter parameters.
    // ─── create_product_set ────────────────────────────────────
    server.tool(
      "create_product_set",
      "Create a new product set within a catalog.",
      {
        catalog_id: z.string().describe("Product catalog ID"),
        name: z.string().describe("Product set name"),
        filter: z.string().optional().describe("JSON string of filter rules for the product set"),
      },
      async ({ catalog_id, ...params }) => {
        try {
          const { data, rateLimit } = await client.post(`/${catalog_id}/product_sets`, { ...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 };
        }
      }
    );
  • Zod schema defining the input parameters for create_product_set: catalog_id (required), name (required), filter (optional JSON string).
    {
      catalog_id: z.string().describe("Product catalog ID"),
      name: z.string().describe("Product set name"),
      filter: z.string().optional().describe("JSON string of filter rules for the product set"),
    },
  • Registration of the tool via server.tool() call inside registerCatalogTools function.
    server.tool(
      "create_product_set",
      "Create a new product set within a catalog.",
      {
        catalog_id: z.string().describe("Product catalog ID"),
        name: z.string().describe("Product set name"),
        filter: z.string().optional().describe("JSON string of filter rules for the product set"),
      },
      async ({ catalog_id, ...params }) => {
        try {
          const { data, rateLimit } = await client.post(`/${catalog_id}/product_sets`, { ...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 };
        }
      }
    );
  • src/index.ts:8-21 (registration)
    Import of registerCatalogTools from catalogs.ts, which registers create_product_set among other catalog tools.
    // --- Tool imports ---
    import { registerCampaignTools } from "./tools/campaigns.js";
    import { registerAdsetTools } from "./tools/adsets.js";
    import { registerAdTools } from "./tools/ads.js";
    import { registerCreativeTools } from "./tools/creatives.js";
    import { registerImageTools } from "./tools/images.js";
    import { registerVideoTools } from "./tools/videos.js";
    import { registerCanvasTools } from "./tools/canvas.js";
    import { registerAudienceTools } from "./tools/audiences.js";
    import { registerTargetingTools } from "./tools/targeting.js";
    import { registerInsightTools } from "./tools/insights.js";
    import { registerLeadTools } from "./tools/leads.js";
    import { registerCatalogTools } from "./tools/catalogs.js";
  • src/index.ts:71-71 (registration)
    Invocation of registerCatalogTools during server initialization, making create_product_set available.
    registerCatalogTools(server, client);
Behavior2/5

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

With no annotations provided, the description must disclose behavioral traits. It only indicates a write operation ('Create'), but does not cover authorization, rate limits, side effects, or return behavior. The absence of these details impairs agent decision-making.

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?

The description is a single, front-loaded sentence with no wasted words. It directly states the action and resource, achieving excellent conciseness.

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 lack of annotations and output schema, the description should provide more context such as the prerequisite that the catalog must exist, the optional nature of the filter, or expected return value. The current description is too sparse for safe, effective tool 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?

The input schema already provides 100% coverage with descriptions for all three parameters. The tool description adds no extra meaning or clarification beyond the schema, so it meets the baseline but does not improve understanding.

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 identifies the action (create) and resource (product set) within a specific scope (catalog). It distinguishes from sibling tools like 'update_product_set' and 'get_product_set' by verb, but does not explicitly differentiate in the description text.

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, such as 'update_product_set' or 'create_catalog'. No prerequisites or conditions are mentioned, leaving the agent to infer correct usage 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/mikusnuz/meta-ads-mcp'

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