Skip to content

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

GeneratorSourceAuth SupportSpeedBest Use Case
OpenAPIOpenAPI specBearer, API Key, Basic, OAuthFastREST APIs with specs
SDKTypeScript SDKSDK-specificVery FastOfficial SDK packages
MCPMCP serverOAuth, TokenMediumMCP-enabled services
JSON-RPCJSON-RPC APIVariesFastRPC-based services
READMEREADME docsVariesMediumREADME.com documented APIs

Getting Started

  1. Choose your generation method based on what the service provides
  2. Read the specific guide for detailed instructions
  3. Generate your pet using the appropriate CLI command or helper script
  4. Test and customize as needed

Common Workflow

bash
cd pets/my-service

pets generate-[method] --dry-run --verbose

pets generate-[method]

pets validate

pets publish --preview

For SDK generation specifically, use bun scripts/generate-from-sdk.ts --pet <pet-name> from the repository root.

Need Help?