Skip to main content
Glama
hectortemich

@deonpay/mcp-server

by hectortemich

Create a product

deonpay_create_product

Add a new product to your DeonPay catalog. Requires name and unit amount (minimum $10 MXN in centavos). Optionally set SKU, stock tracking, and description.

Instructions

Create a new product in the catalog. Use this when the user says 'add a product called X for $Y' or wants to register inventory items they'll later attach to payment links / checkout sessions. unit_amount is in CENTAVOS and must be at least 1000 ($10.00 MXN minimum on creation). SKU must be unique within the merchant. To track stock, set stock_tracking=true AND provide stock_quantity (>= 0).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesProduct name.
unit_amountYesUnit price in CENTAVOS (minimum 1000 = $10.00 MXN on creation).
descriptionNo
currencyNoISO currency code (default 'MXN').
image_urlNo
skuNoUnique SKU within the merchant catalog.
is_activeNoWhether the product is sellable (default true).
stock_trackingNoEnable inventory tracking.
stock_quantityNoInitial stock count (required when stock_tracking is true).
metadataNo

Implementation Reference

  • The tool registration with async handler that POSTs to /products with the compacted input args.
    server.registerTool(
      "deonpay_create_product",
      {
        title: "Create a product",
        description:
          "Create a new product in the catalog. Use this when the user says 'add a product called X for $Y' or wants to register inventory items they'll later attach to payment links / checkout sessions. unit_amount is in CENTAVOS and must be at least 1000 ($10.00 MXN minimum on creation). SKU must be unique within the merchant. To track stock, set stock_tracking=true AND provide stock_quantity (>= 0).",
        inputSchema: {
          name: z.string().min(1).max(255).describe("Product name."),
          unit_amount: z
            .number()
            .int()
            .min(1000)
            .describe("Unit price in CENTAVOS (minimum 1000 = $10.00 MXN on creation)."),
          description: z.string().max(1000).optional(),
          currency: z.string().length(3).optional().describe("ISO currency code (default 'MXN')."),
          image_url: z.string().url().optional(),
          sku: z.string().max(100).optional().describe("Unique SKU within the merchant catalog."),
          is_active: z.boolean().optional().describe("Whether the product is sellable (default true)."),
          stock_tracking: z.boolean().optional().describe("Enable inventory tracking."),
          stock_quantity: z
            .number()
            .int()
            .min(0)
            .optional()
            .describe("Initial stock count (required when stock_tracking is true)."),
          metadata: z.record(z.unknown()).optional(),
        },
      },
      safeHandler(async (args) => {
        return client.post("/products", compact(args));
      }),
    );
  • Zod input schema for deonpay_create_product: name (required), unit_amount in centavos (min 1000), plus optional description, currency, image_url, sku, is_active, stock_tracking, stock_quantity, metadata.
      inputSchema: {
        name: z.string().min(1).max(255).describe("Product name."),
        unit_amount: z
          .number()
          .int()
          .min(1000)
          .describe("Unit price in CENTAVOS (minimum 1000 = $10.00 MXN on creation)."),
        description: z.string().max(1000).optional(),
        currency: z.string().length(3).optional().describe("ISO currency code (default 'MXN')."),
        image_url: z.string().url().optional(),
        sku: z.string().max(100).optional().describe("Unique SKU within the merchant catalog."),
        is_active: z.boolean().optional().describe("Whether the product is sellable (default true)."),
        stock_tracking: z.boolean().optional().describe("Enable inventory tracking."),
        stock_quantity: z
          .number()
          .int()
          .min(0)
          .optional()
          .describe("Initial stock count (required when stock_tracking is true)."),
        metadata: z.record(z.unknown()).optional(),
      },
    },
  • Registration call in the central tool registry, invoked via registerProductTools in registerAllTools.
    registerProductTools(server, client);
  • safeHandler wraps the tool handler with try/catch to convert thrown errors into MCP error results.
    export function safeHandler<TArgs>(
      fn: (args: TArgs) => Promise<unknown>,
    ): (args: TArgs) => Promise<CallToolResult> {
      return async (args: TArgs) => {
        try {
          const value = await fn(args);
          return jsonResult(value);
        } catch (err) {
          return errorResult(err);
        }
      };
    }
  • compact strips undefined/null/empty-string entries from the input args before sending to the API.
    export function compact<T extends Record<string, unknown>>(obj: T): Partial<T> {
      const out: Record<string, unknown> = {};
      for (const [key, value] of Object.entries(obj)) {
        if (value === undefined || value === null) continue;
        if (typeof value === "string" && value.trim() === "") continue;
        out[key] = value;
      }
      return out as Partial<T>;
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden and discloses key behavioral traits: unit_amount is in centavos with a minimum, SKU must be unique, and stock_tracking requires stock_quantity. These constraints are important for correct usage. It does not cover error handling or response format, but the core behaviors are well communicated.

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 concise (three sentences), front-loads the main purpose, then provides usage context, and ends with key parameter constraints. Every sentence adds value, no filler or redundancy.

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

Completeness4/5

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

Given the tool has 10 parameters and no output schema, the description covers the primary purpose, usage context, and important constraints. It lacks details on authentication, error behavior, or return value, but it is sufficient for an agent to select and invoke the tool correctly in most cases.

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 has a high description coverage (70%) with detailed comments on unit_amount (centavos, minimum) and stock_quantity (required when stock_tracking is true). The description repeats these constraints without adding new semantic information, so the added value is minimal.

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 new product in the catalog' with a specific verb and resource. It also provides example user phrases like 'add a product called X for $Y', which makes the purpose unmistakable. The tool name and context distinguish it from sibling create tools (e.g., for checkout sessions or links).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Use this when the user says...' or 'wants to register inventory items', providing clear guidance on when to invoke. It does not explicitly mention when not to use, but the specificity of the usage scenarios sufficiently differentiates from siblings.

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/hectortemich/deonpay-mcp-server'

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