Skip to main content
Glama

Reprice the original term of a contract

defrr_reprice_contract
Read-onlyIdempotent

Use when the contract's ORIGINAL term (its first term, before any renewal) was priced wrong and needs correcting, whether too high (a credit note) or too low (an additional invoice). Renewals keep their own prices; to correct a renewal use defrr_reprice_renewal. 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>",
      "correctedPrice": "<correctedPrice>"
    },
    "name": "defrr_reprice_contract"
  }
}

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.
effectiveFromNoOnly for a new AGREED price that applies from a month on, rather than a pricing error: the first month (YYYY-MM, within the original 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 (a contract of 12,000 a year that becomes 24,000 from month 3 is billed 10,000 more, not 12,000). Leave it out to correct the price from the start of the 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 original term 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. Changed2 schema fields changed
    • changedInput schema / properties / correctedPrice / description
      Previous value: -"What the original term should have cost, in the schedule's currency. Must be lower than its current price."New value: +"What the original term should have cost, in the schedule's currency. Lower than its current price gives a credit; higher gives an additional invoice."
    • 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 original 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 (a contract of 12,000 a year that becomes 24,000 from month 3 is billed 10,000 more, not 12,000). Leave it out to correct the price from the start of the term.",
      +  "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
      +  "type": "string"
      +}
  2. 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"
      +}
  3. Changed4 schema fields changed
    • changedInput schema / properties / correctedPrice / description
      Previous value: -"What the original term should have cost. Must be lower than its current price."New value: +"What the original term 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"
      +}
  4. 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."
  5. 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)."
  6. First observed

TDQS

A4.1/5.0
Behavior3/5

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

Adds real context beyond the annotations: cost of 2 credits with refund on failure, the locked-month constraint (closed months cannot change, so the correction posts in the next month), and that revenue is reversed or caught up with a `direction` field. However, it never resolves whether this is a preview/quote or a persisted correction, which matters because the readOnlyHint=true annotation sits uneasily beside 'returns the credit note or additional invoice' and 'posted in the next month'. Not a hard contradiction, but a real ambiguity left open.

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?

Front-loads the routing decision, then the error-vs-agreement distinction, then outputs and cost. Sentences are dense but each carries load (e.g., the credit example clarifies the pro-rating arithmetic). Slightly long, and the return-value sentence is a single run-on that takes parsing, but no filler.

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?

A complex nested-schema tool with no output schema, and the description does explain what comes back (the document, the reversal/catch-up, the corrected monthly revenue, the direction field). Cost and failure behavior are covered. The only material gap is persistence — whether the correction is applied or merely quoted.

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 schema already documents every parameter in depth, including the nested term fields and exchangeRate. The description adds the business framing for effectiveFrom (agreed price vs. pricing error) and correctedPrice direction (lower gives credit, higher gives an additional invoice), but leaves lockedThrough and the nested term structure entirely to the schema. Baseline 3.

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 the contract's ORIGINAL term') and pins the scope precisely against the sibling: renewals keep their own prices, and 'to correct a renewal use defrr_reprice_renewal'. An agent can route between the two without opening either schema.

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 (original term priced wrong, too high or too low), when-not (renewals), and a third distinct case routed by parameter: an AGREED new price from a month onward uses effectiveFrom rather than being treated as an error. It even quantifies the difference (12,000/year becoming 24,000 from month 3 is billed 10,000 more, not 12,000).

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.