Skip to main content
Glama

create_product

Add a new product to your subscription catalog. Required fields: name and category. Optionally include description, internal ID, or SKU.

Instructions

Create a product. POST /products. Required: name, category. Optional: description, internalProductId, sku.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesProduct name (required)
categoryYesCategory (required)
descriptionNoDescription
internalProductIdNoInternal product ID
skuNoSKU

Implementation Reference

  • Handler function that validates args via Zod schema, then calls productService.createProduct with the parsed data. Returns error result if validation fails.
    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.path.join(".")}: ${e.message}`).join("; "));
      }
      return handleToolCall(() => productService.createProduct(client, parsed.data));
  • Zod schema for input validation: required name and category, optional description, internalProductId, sku.
    const schema = z.object({
      name: z.string().min(1, "name is required"),
      category: z.string().min(1, "category is required"),
      description: z.string().optional(),
      internalProductId: z.string().optional(),
      sku: z.string().optional(),
    });
  • MCP tool definition (name: 'create_product', description, inputSchema with properties and required fields).
    const definition = {
      name: "create_product",
      description:
        "Create a product. POST /products. Required: name, category. Optional: description, internalProductId, sku.",
      inputSchema: {
        type: "object" as const,
        properties: {
          name: { type: "string", description: "Product name (required)" },
          category: { type: "string", description: "Category (required)" },
          description: { type: "string", description: "Description" },
          internalProductId: { type: "string", description: "Internal product ID" },
          sku: { type: "string", description: "SKU" },
        },
        required: ["name", "category"],
      },
    };
  • Product tools registration function includes createProductTool in the list of product tools.
    export function registerProductTools(): Tool[] {
      return [
        listProductsTool,
        getProductTool,
        createProductTool,
        updateProductTool,
        deleteProductTool,
        updateProductStatusTool,
        linkExternalProductTool,
        unlinkExternalProductTool,
      ];
    }
  • Service function that constructs the payload and calls client.post('/products', payload) to create a product via the API.
    export async function createProduct(
      client: Client,
      body: CreateProductBody
    ): Promise<unknown> {
      const payload = {
        name: body.name,
        category: body.category,
        description: body.description,
        internalProductId: body.internalProductId,
        sku: body.sku,
        effectiveStartDate: body.effectiveStartDate,
        effectiveEndDate: body.effectiveEndDate,
        productRatePlan: body.productRatePlan ?? [],
      };
      return client.post<unknown>("/products", payload);
    }
Behavior2/5

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

No annotations are provided, so the description carries full responsibility. It mentions 'POST /products' but fails to disclose behavioral traits such as idempotency, authorization requirements, side effects, or return value. This is insufficient for a creation tool.

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, with two sentences that front-load the purpose. However, it could benefit from minor additional context without losing conciseness.

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

Completeness3/5

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

With 5 parameters and no output schema or annotations, the description adequately covers inputs but lacks information on response format, validation rules, or prerequisites, which is minimal for correct 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%, so baseline is 3. The description repeats required/optional info and adds 'POST /products', but does not enhance parameter meaning beyond the schema's own descriptions.

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 'Create a product' using a specific verb and resource, and distinguishes from sibling tools like 'create_product_rate_plan' by focusing on product creation. It also specifies the HTTP method and required fields.

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 lists required and optional fields, providing basic usage context, but does not explicitly state when to use this tool over alternatives (e.g., update_product, create_product_rate_plan) or mention any prerequisites or caveats.

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