Skip to main content
Glama

Reprice a renewal

defrr_reprice_renewal
Read-onlyIdempotent

Use when a renewal was priced wrong and needs correcting, whether too high (a credit note) or too low (an additional invoice). For a new price the customer AGREED to from a given month (not an error), pass effectiveFrom. Returns the credit note or additional invoice, the revenue to reverse (price lowered) or catch up (price raised) for months already closed, and the corrected revenue month by month; direction says which. Costs 2 credits (refunded if it fails).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "schedule": "<schedule>",
      "termIndex": "<termIndex>",
      "correctedPrice": "<correctedPrice>"
    },
    "name": "defrr_reprice_renewal"
  }
}

Input Schema

NameRequiredDescriptionDefault
scheduleYesThe contract's terms. The first term needs a startDate; each later term (a renewal) starts the day after the previous one ends when endDateIncluded is true (the default), or on the day the previous one ends when it is false.
termIndexYesWhich term: 1 is the first renewal, 2 the second, and so on. Only the latest renewal can be corrected for now, so give the position of the last term.
effectiveFromNoOnly for a new AGREED price that applies from a month on, rather than a pricing error: the first month (YYYY-MM, within the renewal's own term) at the new price. Earlier months keep the old rate and the credit note or additional invoice is just what the months from here on come to. Leave it out to correct the renewal's price from the start of its term.
lockedThroughNoThe latest month already closed for changes, as YYYY-MM. Revenue in that month and earlier cannot be changed, so the correction is posted in the next month. Leave out or null if no month is closed.
correctedPriceYesWhat the renewal should have cost, in the schedule's currency. Lower than its current price gives a credit; higher gives an additional invoice.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / effectiveFrom
      Added value: +{
      +  "description": "Only for a new AGREED price that applies from a month on, rather than a pricing error: the first month (YYYY-MM, within the renewal's own term) at the new price. Earlier months keep the old rate and the credit note or additional invoice is just what the months from here on come to. Leave it out to correct the renewal's price from the start of its term.",
      +  "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / correctedPrice / description
      Previous value: -"What the renewal should have cost, in the schedule's currency. Must be lower than its current price."New value: +"What the renewal should have cost, in the schedule's currency. Lower than its current price gives a credit; higher gives an additional invoice."
  3. Changed2 schema fields changed
    • changedInput schema / properties / schedule / properties / terms / items / properties / price / description
      Previous value: -"The term's total price."New value: +"The term's total price: for all its units, not per unit."
    • addedInput schema / properties / schedule / properties / terms / items / properties / quantity
      Added value: +{
      +  "description": "Optional: how many units (seats) the term's total price covers, 1 if you leave it out. It doesn't change the schedule, which follows the total; it is recorded with the contract so its unit price can be seen.",
      +  "minimum": 1,
      +  "type": "integer"
      +}
  4. Changed4 schema fields changed
    • changedInput schema / properties / correctedPrice / description
      Previous value: -"What the renewal should have cost. Must be lower than its current price."New value: +"What the renewal should have cost, in the schedule's currency. Must be lower than its current price."
    • addedInput schema / properties / schedule / properties / currency
      Added value: +{
      +  "description": "Only for a contract priced in a foreign currency: its code, such as EUR. Every term's price is then in that currency, and each term needs an exchangeRate.",
      +  "pattern": "^[A-Za-z]{3}$",
      +  "type": "string"
      +}
    • addedInput schema / properties / schedule / properties / exchangeRate
      Added value: +{
      +  "description": "With currency: the rate for every term that has none of its own.",
      +  "exclusiveMinimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / schedule / properties / terms / items / properties / exchangeRate
      Added value: +{
      +  "description": "With currency: how much of your base currency ONE unit of the foreign currency was worth when this term was booked. Corrections use it, so they agree with what was billed.",
      +  "exclusiveMinimum": 0,
      +  "type": "number"
      +}
  5. Changed2 schema fields changed
    • changedInput schema / properties / schedule / description
      Previous value: -"The contract's terms. The first term needs a startDate; each later term (a renewal) starts the day after the previous one ends when endDateIncluded is true, or on the day the previous one ends when it is false."New value: +"The contract's terms. The first term needs a startDate; each later term (a renewal) starts the day after the previous one ends when endDateIncluded is true (the default), or on the day the previous one ends when it is false."
    • changedInput schema / properties / schedule / properties / endDateIncluded / description
      Previous value: -"True if a term's end date is its last day (a 1 Jan to 31 Dec term). False if the end date is the first day of the next term. Defaults to false, so for a new contract send true with the last day the customer is covered (a year from 1 Mar 2026 is endDate 2027-02-28)."New value: +"Always send it. True if a term's end date is its last day (a year from 1 Mar 2026 ends 2027-02-28): use true unless the user's own dates show otherwise. False if the end date is the first day of the next term, as when the user gives the same calendar day a whole number of months later (10 Feb 2027 to 10 Feb 2028, so the last covered day is 9 Feb 2028). Defaults to true if left out."
  6. Changed1 schema field changed
    • changedInput schema / properties / schedule / properties / endDateIncluded / description
      Previous value: -"True if a term's end date is its last day (a 1 Jan to 31 Dec term). False if the end date is the first day of the next term. Defaults to false."New value: +"True if a term's end date is its last day (a 1 Jan to 31 Dec term). False if the end date is the first day of the next term. Defaults to false, so for a new contract send true with the last day the customer is covered (a year from 1 Mar 2026 is endDate 2027-02-28)."
  7. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, and the description adds substantial context beyond them: the credit cost and refund condition, the returned documents, the revenue reversal or catch-up for closed months, the corrected monthly revenue, and the meaning of direction. Nothing in the description contradicts the read-only, idempotent annotation profile.

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?

Three dense but purposeful sentences, front-loaded with the usage condition and followed by the key distinction and return behavior. Every clause carries operational meaning; there is no filler.

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?

The tool has five parameters, nested schedule objects, and no output schema, so return behavior must be described in the definition. The description covers the returned documents, revenue consequences, direction indicator, credit cost, and the effectiveFrom distinction, making it complete enough for an agent to call correctly.

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%, so the schema already documents each parameter mechanically. The description adds semantic intent by framing effectiveFrom as the mechanism for an agreed new price rather than a pricing error, and by tying correctedPrice to the credit-versus-additional-invoice outcome. This is useful beyond the schema, though the schema still does most of the parameter-level work.

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?

States a specific verb and resource ('reprice a renewal') and immediately scopes the two cases it handles: correcting an error versus applying an agreed new price from a month. This distinguishes it from siblings such as process_renewal and cancel_renewal without ambiguity.

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

Usage Guidelines5/5

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

Gives explicit when-to-use guidance ('a renewal was priced wrong'), distinguishes the error case from the agreed-price case by instructing when to pass effectiveFrom, and explains what each direction produces. It also branches into the too-high and too-low outcomes, leaving little to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.