1. Minimal Schema
The simplest possible schema: a single route with no parameters, no handlers, and no shared lists. This is the CoinGecko API ping endpoint.- No
requiredServerParams— this API needs no authentication - No
handlersexport — the raw API response is returned as-is - The
output.schemadescribes what the AI client receives parameters: []means no user input is needed
2. Multi-Route Schema with Handlers
Multiple routes in one schema, withpostRequest handlers that filter and reshape API responses. This wraps the DeFi Llama protocol analytics API.
- Four routes in one schema covering related endpoints
location: 'insert'substitutes parameters into the URL path- The
handlersexport transforms responses for two of the four routes - Routes without handlers return the raw API response
- The handler factory receives
{ sharedLists, libraries }even when unused
3. Shared List Schema
Demonstrates shared list references and{{listName:fieldName}} interpolation. This Etherscan gas tracker schema uses the evmChains shared list to generate a chain selector enum.
sharedListsdeclares which shared lists this schema needsfilter: { key: 'etherscanAlias', exists: true }excludes chains without an Etherscan alias (Avalanche is filtered out)enum({{evmChains:etherscanAlias}})generatesenum(["ETH","POLYGON","ARBITRUM","BASE","BSC"])at load time{{SERVER_PARAM:ETHERSCAN_API_KEY}}injects the API key from the environment- Fixed parameters like
moduleandactionhave hardcoded values (not{{USER_PARAM}})
4. Async Workflow Schema
A multi-step API workflow with execute, poll status, and retrieve results. This wraps the Dune Analytics query execution pipeline.- Three routes form an async workflow: execute, poll, retrieve
- The AI agent calls
executeQueryfirst to get anexecution_id - Then polls
getExecutionStatusuntilstateis"QUERY_STATE_COMPLETED" - Finally retrieves results with
getExecutionResults - Each route uses
{{SERVER_PARAM:DUNE_API_KEY}}for authentication - The AI client orchestrates the multi-step flow using the tool descriptions
Async workflow schemas work naturally with AI agents. The agent reads the tool descriptions, understands the execute-poll-retrieve pattern, and orchestrates the calls in sequence.
Pattern Summary
| Pattern | When to use | Example |
|---|---|---|
| Minimal | Simple endpoints with no auth | Health checks, public APIs |
| Multi-Route | Related endpoints from one API | Protocol analytics, user management |
| Shared List | Multi-chain or multi-provider schemas | EVM chain selection, exchange lists |
| Async Workflow | APIs with execute/poll/retrieve patterns | Query engines, batch processing |