Skip to main content
Glama
hectortemich

@deonpay/mcp-server

by hectortemich

Get product details

deonpay_get_product

Retrieve product details including name, description, price, and stock information by providing a product UUID or SKU.

Instructions

Fetch a single product by UUID OR by SKU (if you pass a non-UUID string the API resolves it as a SKU). Returns name, description, unit_amount in centavos, currency, image_url, sku, is_active, stock_tracking, stock_quantity and metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesProduct UUID or SKU.

Implementation Reference

  • Registration of the deonpay_get_product tool with schema (id required) and handler. The tool calls GET /api/v1/products/{id} via the DeonpayClient.
    server.registerTool(
      "deonpay_get_product",
      {
        title: "Get product details",
        description:
          "Fetch a single product by UUID OR by SKU (if you pass a non-UUID string the API resolves it as a SKU). Returns name, description, unit_amount in centavos, currency, image_url, sku, is_active, stock_tracking, stock_quantity and metadata.",
        inputSchema: {
          id: z.string().min(1).describe("Product UUID or SKU."),
        },
      },
      safeHandler(async ({ id }) => {
        return client.get(`/products/${encodeURIComponent(id)}`);
      }),
    );
  • The handler for deonpay_get_product — it extracts the `id` argument (UUID or SKU), URL-encodes it, and makes a GET request to `/products/{id}` via the HTTP client.
      safeHandler(async ({ id }) => {
        return client.get(`/products/${encodeURIComponent(id)}`);
      }),
    );
  • Input schema: one required `id` field (string, min length 1) described as a product UUID or SKU.
    inputSchema: {
      id: z.string().min(1).describe("Product UUID or SKU."),
    },
  • safeHandler wraps the handler function with try/catch, converting success to pretty JSON result and errors to 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);
        }
      };
    }
Behavior4/5

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

No annotations provided, but the description discloses the resolution logic (UUID vs SKU) and lists all return fields. This provides good behavioral context beyond the schema.

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?

Two concise sentences with no wasted words. The most critical information (purpose and parameter behavior) is front-loaded.

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

Completeness5/5

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

No output schema, but the description enumerates all returned fields. For a simple get-by-id tool with one parameter, the description covers all necessary context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for the single 'id' parameter. The description adds extra semantic value by explaining the UUID/SKU resolution and listing the returned fields, going beyond the schema.

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?

Clearly states it fetches a single product by UUID or SKU, which is a specific verb and resource. Distinguishes from sibling tools like list_products that return multiple products.

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?

No explicit when-to-use or alternatives. While the purpose is clear, it does not mention that for non-identifier-based queries one should use list_products.

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