Skip to main content

Examples

Practical examples for common use cases using fetch().
These examples use the JSON-RPC endpoint (/mcp). For the simpler REST endpoint (/v1/mcp/tools/call), see the Python SDK.

Basic Inference

Multi-turn Conversation

Code Execution (Sandbox)

Batch Processing

Budget Protection

Error Recovery