Auto-Generation Tools
OpenPets provides powerful auto-generation tools to quickly create pets from existing APIs and services. Instead of manually writing tool definitions, you can automatically generate them from various sources.
Available Generators
OpenAPI Generation
Generate pets from OpenAPI/Swagger specifications.
Best for: REST APIs with OpenAPI specs, API-first products
Command: pets generate-openapi
Features:
- Supports OpenAPI 3.0/3.1
- Multiple auth methods (Bearer, API Key, Basic)
- Dynamic base URLs for environment switching
- Request body expansion
- Core endpoints for selective tool loading
- Tool name cleaning
Examples: Cal.com, Trading 212, AI Harmony, Commander
SDK Generation
Generate pets from TypeScript SDK packages.
Best for: Services with official TypeScript SDKs (@polar-sh/sdk, @stripe/stripe-node, etc.)
Command: bun scripts/generate-from-sdk.ts --pet <pet-name>
Features:
- Direct SDK integration
- Type-safe method calls
- Automatic pagination handling
- Read-only mode filtering
- Pattern-based schema generation
Examples: Polar, Stripe
MCP Server Generation
Generate pets from Model Context Protocol (MCP) servers.
Best for: Services with official MCP servers (Asana, Atlassian, etc.)
Command: pets generate-mcp
Features:
- OAuth and token authentication
- Schema extraction from MCP servers
- Local or remote server support
- Full MCP protocol compatibility
Examples: Asana, Atlassian, Brave Search
JSON-RPC Generation
Generate pets from JSON-RPC APIs.
Best for: JSON-RPC based services
Command: pets generate-jsonrpc
Features:
- JSON-RPC 2.0 protocol support
- Method introspection
- Type-safe parameter handling
README API Generation
Generate pets from README.com API reference documentation.
Best for: Services documented on README.com
Command: pets generate-readme --registry <id>
Features:
- Automatic endpoint discovery
- Parameter extraction from docs
- Authentication pattern detection
Quick Comparison
| Generator | Source | Auth Support | Speed | Best Use Case |
|---|---|---|---|---|
| OpenAPI | OpenAPI spec | Bearer, API Key, Basic, OAuth | Fast | REST APIs with specs |
| SDK | TypeScript SDK | SDK-specific | Very Fast | Official SDK packages |
| MCP | MCP server | OAuth, Token | Medium | MCP-enabled services |
| JSON-RPC | JSON-RPC API | Varies | Fast | RPC-based services |
| README | README docs | Varies | Medium | README.com documented APIs |
Getting Started
- Choose your generation method based on what the service provides
- Read the specific guide for detailed instructions
- Generate your pet using the appropriate CLI command or helper script
- Test and customize as needed
Common Workflow
cd pets/my-service
pets generate-[method] --dry-run --verbose
pets generate-[method]
pets validate
pets publish --previewFor SDK generation specifically, use bun scripts/generate-from-sdk.ts --pet <pet-name> from the repository root.
Need Help?
- Development Guide - Comprehensive pet creation guide
- Best Practices - Pet development patterns
- Examples - 50+ real-world pet examples