Skip to main content
Glama

link_external_product

Link an external product from an integrated platform to a Rebillia product, enabling subscription billing modifiers with a display name.

Instructions

Link an external product to a product. POST /products/{productId}/external-products. Required: companyIntegrationId, productId (external), settings with modifierDisplayName.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
productIdYesRebillia product ID (required)
companyIntegrationIdYesCompany integration ID (required)
productIdExternalYesExternal product ID from the integration (required)
modifierDisplayNameYesDisplay name for the modifier (required, part of settings)
displayStyleNoe.g. dropdown
requiredNoWhether the external product is required
defaultRatePlanNoDefault rate plan

Implementation Reference

  • The handler function that parses arguments via Zod schema, constructs the request body, and calls productService.linkExternalProduct to POST /products/{productId}/external-products.
    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("; "));
      }
      const {
        productId,
        companyIntegrationId,
        productIdExternal,
        modifierDisplayName,
        displayStyle,
        required,
        defaultRatePlan,
      } = parsed.data;
      const body = {
        companyIntegrationId,
        productId: productIdExternal,
        settings: { modifierDisplayName },
        displayStyle,
        required,
        defaultRatePlan,
      };
      return handleToolCall(() => productService.linkExternalProduct(client, productId, body));
    }
  • Zod schema defining input validation: requires productId, companyIntegrationId, productIdExternal, modifierDisplayName; optional displayStyle, required, defaultRatePlan.
    const schema = z.object({
      productId: z.string().min(1, "productId is required"),
      companyIntegrationId: z.number().int().positive(),
      productIdExternal: z.string().min(1, "external productId is required"),
      modifierDisplayName: z.string().min(1, "modifierDisplayName is required"),
      displayStyle: z.string().optional(),
      required: z.boolean().optional(),
      defaultRatePlan: z.string().optional(),
    });
  • Registration of linkExternalProductTool in the registerProductTools array, which is called by the main tool registry.
    /** All 8 product tools. Register with the main tool registry. */
    export function registerProductTools(): Tool[] {
      return [
        listProductsTool,
        getProductTool,
        createProductTool,
        updateProductTool,
        deleteProductTool,
        updateProductStatusTool,
        linkExternalProductTool,
        unlinkExternalProductTool,
  • The service function that makes the actual HTTP POST call to /products/{productId}/external-products with the link body.
    export async function linkExternalProduct(
      client: Client,
      productId: string,
      body: LinkExternalProductBody
    ): Promise<unknown> {
      return client.post<unknown>(`/products/${productId}/external-products`, body);
    }
  • TypeScript interface for the LinkExternalProductBody used in the service call.
    export interface LinkExternalProductBody {
      companyIntegrationId: number;
      productId: string;
      settings: { modifierDisplayName: string; [k: string]: unknown };
      displayStyle?: string;
      required?: boolean;
      defaultRatePlan?: string;
      modifierDiscountRules?: unknown;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the POST method implying mutation but does not disclose side effects like overwriting existing links, idempotency, or error behavior. This is insufficient for a mutation tool.

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 two sentences: one for purpose with endpoint, one for required parameters. No extraneous information, every phrase is useful. Ideal for quick scanning.

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 no output schema and the complexity of linking two entities, the description should explain what a successful link achieves, constraints, and error conditions. It only covers required fields, leaving significant gaps for an AI agent to fully understand the tool's behavior.

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 description coverage is 100%, so the baseline is 3. The description rephrases required parameters but adds no new meaning beyond what the schema already provides. Slight naming mismatch (productId external vs productIdExternal) does not improve clarity.

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 the action ('Link an external product to a product') and includes the HTTP method and endpoint. This distinguishes it from sibling tools like unlink_external_product, get_external_product, and list_external_products, as the verb 'link' is unique and specific.

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?

The description only lists required parameters but provides no guidance on when to use this tool versus alternatives, nor does it explain prerequisites (e.g., that the external product must already exist). There is no explicit context for usage 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/rhinosaas/rebillia-mcp-server'

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