Skip to main content
Glama

update_product_rate_plan

Update an existing product rate plan by modifying its name, type, description, effective dates, or image using the rate plan ID.

Instructions

Update a rate plan. PUT /product-rateplans/{ratePlanId}. Optional: name, type (contract|ongoing|prepaid), description, effectiveStartDate, effectiveEndDate, image.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ratePlanIdYesRate plan ID (URI: /product-rateplans/{ratePlanId})
nameNoRate plan name
typeNoType: contract, ongoing, or prepaid
descriptionNoDescription
effectiveStartDateNoEffective start date
effectiveEndDateNoEffective end date
minimumCommitmentNoMinimum commitment
minimumCommitmentLengthNoMinimum commitment length
minimumCommitmentUnitNoMinimum commitment unit
changeStatusBasedOnChargeNoChange status based on charge
imageNoImage

Implementation Reference

  • Handler function for update_product_rate_plan tool. Parses input with Zod schema, extracts ratePlanId, and delegates to ratePlanService.updateRatePlan.
    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.message).join("; "));
      }
      const { ratePlanId, ...body } = parsed.data;
      return handleToolCall(() => ratePlanService.updateRatePlan(client, ratePlanId, body));
    }
  • Zod validation schema and tool definition (name: update_product_rate_plan, inputSchema with properties for ratePlanId, name, type, description, effectiveStartDate, effectiveEndDate, minimumCommitment, minimumCommitmentLength, minimumCommitmentUnit, changeStatusBasedOnCharge, image).
    import { z } from "zod";
    import type { Tool } from "../types.js";
    import type { Client } from "./helpers.js";
    import { errorResult, handleToolCall } from "./helpers.js";
    import * as ratePlanService from "../../services/productRatePlanServices.js";
    
    const schema = z.object({
      ratePlanId: z.string().min(1, "ratePlanId is required"),
      name: z.string().optional(),
      type: z.enum(["contract", "ongoing", "prepaid"]).optional(),
      description: z.string().optional(),
      effectiveStartDate: z.string().optional(),
      effectiveEndDate: z.string().optional(),
      minimumCommitment: z.boolean().optional(),
      minimumCommitmentLength: z.number().optional(),
      minimumCommitmentUnit: z.string().optional(),
      changeStatusBasedOnCharge: z.boolean().optional(),
      image: z.string().optional(),
    });
    
    const definition = {
      name: "update_product_rate_plan",
      description:
        "Update a rate plan. PUT /product-rateplans/{ratePlanId}. Optional: name, type (contract|ongoing|prepaid), description, effectiveStartDate, effectiveEndDate, image.",
      inputSchema: {
        type: "object" as const,
        properties: {
          ratePlanId: { type: "string", description: "Rate plan ID (URI: /product-rateplans/{ratePlanId})" },
          name: { type: "string", description: "Rate plan name" },
          type: { type: "string", description: "Type: contract, ongoing, or prepaid" },
          description: { type: "string", description: "Description" },
          effectiveStartDate: { type: "string", description: "Effective start date" },
          effectiveEndDate: { type: "string", description: "Effective end date" },
          minimumCommitment: { type: "boolean", description: "Minimum commitment" },
          minimumCommitmentLength: { type: "number", description: "Minimum commitment length" },
          minimumCommitmentUnit: { type: "string", description: "Minimum commitment unit" },
          changeStatusBasedOnCharge: { type: "boolean", description: "Change status based on charge" },
          image: { type: "string", description: "Image" },
        },
        required: ["ratePlanId"],
      },
    };
  • Tool object export combining the definition and handler, registered as updateRatePlanTool.
    export const updateRatePlanTool: Tool = {
      definition,
      handler,
    };
  • Import of updateRatePlanTool into the rate plan tools barrel module for registration.
    import { updateRatePlanTool } from "./updateRatePlan.js";
  • Service function updateRatePlan that makes PUT /product-rateplans/{ratePlanId} API call, filtering out undefined fields from the request body.
    export async function updateRatePlan(
      client: Client,
      ratePlanId: string,
      body: UpdateRatePlanBody
    ): Promise<unknown> {
      const payload = Object.fromEntries(
        Object.entries(body).filter(([, v]) => v !== undefined)
      ) as UpdateRatePlanBody;
      return client.put<unknown>(
        `/product-rateplans/${ratePlanId}`,
        Object.keys(payload).length ? payload : undefined
      );
    }
Behavior2/5

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

With no annotations, description carries full burden but merely lists optional fields from schema. Does not disclose whether update is partial or full replacement, idempotency, or side effects like affecting subscriptions.

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?

Short and front-loaded with clear action. The list of optional fields is helpful, though the HTTP path could be omitted if redundant with schema.

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 11 parameters, no output schema, and many sibling tools, the description is too sparse. No mention of success response, error handling, or integration with other update/rate plan tools.

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

Parameters2/5

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

Schema has 100% coverage, so baseline is 3. Description lists a subset of parameters (e.g., omits 'minimumCommitment' and 'changeStatusBasedOnCharge') and adds no new meaning beyond what's already in field descriptions.

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?

Clearly states 'Update a rate plan' with HTTP method and path, identifying the verb and resource. However, it does not explicitly distinguish from sibling update tools like 'update_product_rate_plan_charge'.

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 like 'create_product_rate_plan' or 'update_product_rate_plan_status'. Lacks prerequisites or context on rate plan lifecycle.

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