MCP Tools Reference
Complete reference for guardrail-sim's MCP tools
MCP Tools Reference
guardrail-sim exposes 5 tools through the Model Context Protocol for AI agent integration.
Setup
Start the MCP server:
Add to Claude Desktop config:
evaluate_policy
Evaluate a proposed discount against the active pricing policy.
Use this tool when:
- A B2B buyer requests a discount
- You need to check if a discount is allowed before committing
- You want to understand the policy constraints for negotiation
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
order | Order | Yes | The order details for evaluation |
proposed_discount | number | Yes | Requested discount as decimal (0.15 = 15% off) |
Order object:
| Field | Type | Required | Description |
|---|---|---|---|
order_value | number | Yes | Total order value in dollars |
quantity | number | Yes | Total units in the order |
product_margin | number | Yes | Base margin as decimal (0.40 = 40%) |
customer_segment | string | No | Customer tier (new, bronze, silver, gold, platinum) |
Example:
Response:
Response (rejected):
get_policy_summary
Get a human-readable summary of the active policy rules.
Use this tool when:
- You need to explain discount limits to a buyer
- You want to understand what discounts are possible
- Preparing for a negotiation
Parameters: None
Example:
Response:
get_max_discount
Calculate the maximum allowed discount for a given order.
Use this tool when:
- You want to know the ceiling for negotiation
- A buyer asks "what's the best you can do?"
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
order | Order | Yes | The order details |
Example:
Response:
UCP-Aligned Tools
These tools return responses conforming to the Universal Commerce Protocol specification for agentic commerce.
validate_discount_code
Pre-validate a discount code before applying it to a checkout. Returns UCP-standard error codes.
Use this tool when:
- An AI agent wants to pre-validate a discount before checkout
- You need UCP-compliant error codes for discount rejection
- Building UCP-compatible checkout flows
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | The discount code to validate |
discount_amount | number | Yes | Discount amount in minor currency units (cents) |
order | Order | Yes | Order context for validation |
Example:
Response (approved):
Response (rejected):
UCP Error Codes
| Error Code | Description |
|---|---|
discount_code_invalid | Code doesn't exist or exceeds limits |
discount_code_expired | Code is past validity window |
discount_code_user_ineligible | User doesn't qualify for this discount |
discount_code_combination_disallowed | Can't combine with other codes |
discount_code_user_not_logged_in | Requires authentication |
simulate_checkout_discount
Simulate a UCP checkout with discount codes applied.
Use this tool when:
- Testing how discounts would be applied in a UCP checkout
- Simulating multi-code discount scenarios
- Validating discount stacking behavior
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
codes | string[] | Yes | Array of discount codes to apply |
line_items | LineItem[] | Yes | UCP line items for the checkout |
currency | string | Yes | ISO 4217 currency code (e.g., USD) |
discount_percentage | number | Yes | Discount percentage to simulate (0.15 = 15%) |
product_margin | number | No | Base margin for policy evaluation (0.40 = 40%) |
LineItem structure:
Example:
Response (approved):
Response (rejected):
Best Practices
For Negotiation
- Start with
get_policy_summaryto understand the rules - Use
get_max_discountto find the ceiling - Call
evaluate_policyto test specific discount levels
For UCP Integration
- Use
validate_discount_codefor pre-checkout validation - Use
simulate_checkout_discountfor full checkout simulation - Handle UCP error codes appropriately in your checkout flow