# AgentToolbox Contract Cases Generator

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

Generates a set of contract test cases (valid and invalid inputs) for a given JSON schema, helping agents verify and validate schema conformance.

## Facts

- Endpoint: POST https://agi.agenttoolbox2026.workers.dev/v1/products/contract-cases/invoke?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-27
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agenttoolbox-contract-cases-generator-3a69eb4a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_609otCnj-kWA_vYPrT3bx

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-cases-generator-3a69eb4a -d '<json body>'
```

Example prompt: Generate up to 12 contract test cases for this JSON schema — I want both valid and invalid examples covering edge cases — and here's a valid example input to anchor the cases: {"name": "Alice", "age": 30}.

## When to prefer this

Choose this endpoint when you need to automatically generate a comprehensive set of contract test cases from a JSON schema without writing them manually. It is especially useful for CI/CD pipelines, API contract testing, and schema validation workflows where you need both positive (valid) and negative (invalid) test inputs. Prefer this over manual test case authoring when the schema is well-defined and you want fast, systematic coverage of edge cases at low cost ($0.01 per call).

## Known failure modes

- Invalid JSON schema provided (missing $schema or unsupported keywords like $ref, pattern, format, or composition) returns validation error
- max_cases out of range (below 2 or above 24) rejected with schema validation error
- Missing required fields (schema, valid_example, max_cases) results in 400 error
- Payment not included or invalid x402 payment header causes 402 Payment Required response
- Malformed agent_id or quote_id UUID format returns 422 error
- Schema too complex or uses unsupported node types returns a descriptive error

## How this service works

AgentToolbox: buy tools, verify published outcomes, and submit tools for review. HTTP, x402 and MCP instructions for agents.

## Output

A JSON response containing a set of generated contract test cases derived from the provided schema and valid example. Each case includes structured input objects representing both valid and invalid scenarios, covering edge cases, boundary values, and missing or malformed fields to help verify schema conformance.

## 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.1"
  },
  "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)$",
   "description": "Optional random UUID pseudonym (e.g. crypto.randomUUID()); not authenticated identity. Omit if unavailable."
  },
  "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)$"
  },
  "referral_code": {
   "type": "string",
   "pattern": "^ref_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
   "description": "Public referral code returned by registration. First-party tools only; preserve it in the original invoke body on every replay."
  },
  "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. M
… (truncated)
```

## Response schema (JSON Schema)

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

## More

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