Skip to main content
Glama

Set opportunity products

set_opportunity_products
DestructiveIdempotent

Replace an opportunity's entire product set and derive its value. Pass catalog product IDs/quantities, never prices; [] clears all lines and sets value to zero. The server snapshots unit_price_cents and computes totals: per_unit multiplies by quantity, flat charges once (quantity >1 is flagged). Discounts are percentages via line/top-level discount_pct; the server computes money. Bundles expand automatically; out-of-tier quantities are flagged, not blocked. include_discontinued:true allows a discontinued item on an existing agreement. Returns the fresh opportunity, priced lines and flags.

When to use: Price a deal from selected products after applying the opportunity_products template.

Example: Put 15 standard-plan units on Acme’s deal.

Input Schema

NameRequiredDescriptionDefault
linesYesThe WHOLE product set (replace-all): [{product_id: product uuid, quantity: integer ≥ 0, discount_pct?: 0–100, include_discontinued?: boolean}]; [] clears every line.
discount_pctNoA number from 0 to 100.
opportunity_idYesA uuid.

Output Schema

NameRequiredDescriptionDefault
noteNo
updatedNo
guidanceNo
line_itemsNo
opportunityNo
missing_objectsNo
tier_validationsNo
pricing_mode_validationsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • removedInput schema / properties / discount_pct / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / discount_pct / type
      Added value: +[
      +  "number",
      +  "string"
      +]
    • removedInput schema / properties / lines / items / properties / discount_pct / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / lines / items / properties / discount_pct / type
      Added value: +[
      +  "number",
      +  "string"
      +]
    • removedInput schema / properties / lines / items / properties / include_discontinued / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "number"
      -  }
      -]
    • addedInput schema / properties / lines / items / properties / include_discontinued / type
      Added value: +[
      +  "boolean",
      +  "string",
      +  "number"
      +]
    • removedInput schema / properties / lines / items / properties / quantity / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / lines / items / properties / quantity / type
      Added value: +[
      +  "number",
      +  "string"
      +]
  2. Changed1 schema field changed
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
  3. Changed12 schema fields changed
    • removedOutput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • removedOutput schema / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / guidance / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / guidance / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / line_items / items / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / line_items / items / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • removedOutput schema / properties / opportunity / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / opportunity / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • removedOutput schema / properties / pricing_mode_validations / items / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / pricing_mode_validations / items / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • removedOutput schema / properties / tier_validations / items / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / tier_validations / items / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

The description adds substantial behavior beyond annotations: catalog IDs and quantities are required rather than prices, the server snapshots unit_price_cents, computes per-unit vs flat totals, treats discounts as percentages, expands bundles, and flags rather than blocks out-of-tier quantities. It also explains that include_discontinued permits a discontinued item only on an existing agreement. These details align with destructiveHint=true because the replace-all behavior and clearing semantics are explicit.

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 definition is front-loaded with the replace-all contract, then pricing/discount/bundle rules, then usage and an example. Every sentence carries operational meaning, and no line is wasted on restating annotations or schema text.

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?

This is a complex destructive pricing mutation, and the description covers the important edge cases: clearing lines, zeroing value, server-side price derivation, discounts, bundles, discontinued items, and returned opportunity/priced lines/flags. With annotations and an output schema also present, an agent has enough to invoke it safely.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds real semantic meaning: lines is the WHOLE product set, [] clears everything, product inputs are catalog IDs and quantities rather than prices, discount_pct is a percentage at line or top level, and include_discontinued has a specific agreement condition. It explains how quantities are interpreted for per_unit and flat pricing.

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 states a specific verb and resource: 'Replace an opportunity's entire product set and derive its value.' It immediately clarifies replace-all semantics, including that [] clears all lines, so an agent can distinguish this from a partial update or quote-creation tool.

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

Usage Guidelines4/5

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

It gives a clear when-to-use trigger: price a deal from selected products after applying the opportunity_products template. The example reinforces this. It does not explicitly name when not to use it or name sibling alternatives, so it falls short of a 5.

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.

Resources