JSON Schema for Structured Outputs & Function Calling

Reusable schemas for LLM tool use and AI agents. Works with Claude, ChatGPT, Gemini, Pydantic, Zod, and LangChain.

Explore Schemas View on GitHub
📐

Design Patterns

Gang of Four patterns, Repository, CQRS, Event Sourcing, and more.

🔗

Composable

Reference definitions across schemas. Build complex types from primitives.

Validation Ready

JSON Schema draft-07. Works with Pydantic, Zod, and any validator.

🧠

LLM Structured Outputs

Built for function calling and tool use. Compatible with Claude, ChatGPT, Gemini, and AI agent frameworks.

Schema Library

functional.schema.json

AI-readable functional programming primitives for effect handling, composition, and data transformation.

Functor Monad Lens IO Stream

domain.schema.json

Domain-Driven Design building blocks for modeling complex business domains.

Entity Aggregate Repository Saga

algebra.schema.json

Algebraic structures with verifiable properties for reliable distributed systems.

Semigroup Monoid CRDT Lattice

concurrency.schema.json

Job composition and scheduling primitives using monoidal patterns.

Job Scheduler WorkerPool DAG

gof-patterns.schema.json

Classic Gang of Four patterns plus modern architecture patterns.

Factory Observer Strategy Circuit Breaker

automata.schema.json

LLM-parseable Chomsky hierarchy: finite automata, pushdown automata, Turing machines, and formal grammars.

DFA NFA PDA TuringMachine

data-structures.schema.json

AI-readable data structure definitions with discriminator-based ordering for lists, trees, heaps, and spatial indices.

List BST Heap KDTree QuadTree

data-structures-advanced.schema.json

Hash tables, tries, balanced trees, graphs, and specialized structures for range queries and caching.

HashMap BloomFilter Trie RedBlackTree LRUCache

Usage

# Fetch a schema
curl https://schema.ninja/schemas/domain.schema.json

# Reference in your JSON Schema
{
  "$ref": "https://schema.ninja/schemas/domain.schema.json#/definitions/Entity"
}

# Or use specific definitions
{
  "type": "object",
  "properties": {
    "user": { "$ref": "https://schema.ninja/schemas/domain.schema.json#/definitions/AggregateRoot" },
    "result": { "$ref": "https://schema.ninja/schemas/functional.schema.json#/definitions/Result" }
  }
}