# AgentToolbox Contract Case Generator

> AgentToolbox Contract Case Generator is a paid API for AI agents from agnttoolbx.agenttoolbox2026.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-14).

Generates a set of contract test cases (valid and invalid) from a JSON Schema plus a valid example, for use in API/schema testing workflows.

## Facts

- Endpoint: POST https://agnttoolbx.agenttoolbox2026.workers.dev/v1/products/contract-cases/invoke?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agenttoolbox-contract-case-generator-6a0cafc3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_I-DWS6LS8Lvsu4l-kek3m

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agenttoolbox-contract-case-generator-6a0cafc3 -d '<json body>'
```

Example prompt: Generate up to 12 contract test cases for this JSON Schema — include both valid and edge-case invalid inputs — using this valid example object: {"name": "Alice", "age": 30, "email": "alice@example.com"}, and a schema that requires name (string), age (integer, min 0), and email (string).

## When to prefer this

Choose this endpoint when you need a quick, paid-per-call service to automatically generate structured contract test cases from a JSON Schema without writing them manually. It is well-suited for CI pipelines, agent tool testing, and schema regression suites where you have a known valid example and want both positive and negative cases enumerated rapidly. Prefer it over manual case authoring or LLM prompting when you want deterministic, schema-grounded outputs at low cost ($0.01/call).

## Known failure modes

- Schema includes unsupported features (references, patterns, formats, composition) — rejected with a validation error
- Schema nodes missing explicit single 'type' — rejected as malformed
- max_cases out of range (below 2 or above 24) — rejected
- valid_example does not match the provided schema — may result in an error or degenerate cases
- Payment amount does not match quoted amount — payment rejected
- Missing required fields (schema, valid_example, max_cases) — request rejected

## How this service works

Useful tools for agents. Small requests. Concrete results.

## Output

A JSON response containing a collection of contract test cases derived from the provided schema and valid example. Each case likely includes the input object and a label indicating whether it is expected to be valid or invalid, along with information about which schema constraint it targets or violates. The number of cases is bounded by max_cases (2–24, default 12).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "$schema": "https://json-schema.org/draft/2020-12/schema",
   "required": [
    "schema",
    "valid_example",
    "max_cases"
   ],
   "properties": {
    "schema": {
     "type": "object",
     "description": "Explicit $schema=https://json-schema.org/draft/2020-12/schema required. Bounded subset; every schema node needs a single type. No references, patterns, formats or composition.",
     "propertyNames": {
      "type": "string"
     },
     "additionalProperties": {}
    },
    "max_cases": {
     "type": "integer",
     "default": 12,
     "maximum": 24,
     "minimum": 2
    },
    "valid_example": {}
   },
   "additionalProperties": false
  },
  "version": {
   "type": "string",
   "const": "0.1.0"
  },
  "agent_id": {
   "type": "string",
   "format": "uuid",
   "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
  },
  "quote_id": {
   "type": "string",
   "format": "uuid",
   "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
  },
  "prepared_id": {
   "type": "string",
   "format": "uuid",
   "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
  },
  "review_secret_hash": {
   "type": "string",
   "pattern": "^[0-9a-f]{64}$",
   "description": "Optional SHA-256 hex of caller-kept atbr_ secret (32 random bytes). Bound to this paid request; never send the raw secret here."
  },
  "payment_amount_atomic": {
   "type": "string",
   "pattern": "^(0|[1-9][0-9]{0,77})$",
   "description": "Canonical decimal USDC atomic-unit string (6 decimals). Protocol uint256 maximum 115792089237316195423570985008687907853269984665640564039457584007913129639935. No business maximum. Product minimum: 10000. Must equal the exact quoted/signed amount."
  },
  "max_charge_usdc_atomic": {
   "anyOf": [
    {
     "type": "string",
     "pattern": "^(0|[1-9][0-9]{0,77})$",
     "description": "Canonical decimal USDC atomic-unit string (6 decimals). Protocol uint256 maximum 115792089237316195423570985008687907853269984665640564039457584007913129639935. No business maximum."
    },
    {
     "type": "integer",
     "maxim
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agenttoolbox-contract-case-generator-6a0cafc3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agnttoolbx.agenttoolbox2026.workers.dev](https://www.zero.xyz/host/agnttoolbx.agenttoolbox2026.workers.dev/llms.txt)
