Tool Schemas
Model Context Protocol (MCP) tool schemas define the exact interfaces that AI models like Claude use to interact with your APIs. LegacyAI automatically maps your OpenAPI specifications directly into these secure, type-safe MCP tool schemas.
How it works
When you upload your Swagger or OpenAPI file, LegacyAI parses the endpoints and translates them into a JSON Schema format that the Model Context Protocol understands. This schema acts as a strict contract:
Input Validation
Ensures the AI only sends parameters that match your API's expected data types and formats (using Zod validation under the hood).
Safe Execution
Prevents hallucinations by restricting the model to predefined, explicit operations mapped directly from your spec.
Best Practices for your OpenAPI Spec
- Write clear descriptions: AI models rely heavily on the
descriptionfields in your OpenAPI spec to understand when and how to use a tool. Be descriptive! - Define strict schemas: Clearly define your request bodies and response objects. Avoid using loose types like generic objects when possible.
- Use Operation IDs: LegacyAI uses the
operationIdto name the generated MCP tool. Make them concise and descriptive (e.g.,getUserProfile).
Ready to generate your first tool?
Upload your OpenAPI spec in the dashboard and we'll handle the complex schema generation automatically.
Go to Dashboard