Skip to navigation

Import from OpenAPI

Create tools from an OpenAPI document you already maintain, then refine them so agents use them correctly.
View as Markdown

If your API is described by an OpenAPI document, you can create your tools from it rather than adding each one individually. Mitu reads the operations in the document and creates a tool for each, with its name, method, path, description and schemas populated from the information the document already contains.

An OpenAPI document is written for developers, while a tool must also help an agent decide when to use it. The import therefore provides a complete technical starting point, which you then refine with the guidance, access rules and pricing that only you can supply.

What the import provides

Tool settingTaken from
NameThe operation’s operationId, or its method and path when no identifier is set
Method and pathThe operation’s method and path
DescriptionThe operation’s summary, or its description when no summary is set
Input schemaThe operation’s parameters and JSON request body
Output schemaThe JSON body of the operation’s 200 or 201 response
Requires sign inSet when the operation declares a security requirement

Every imported tool starts free, and an operation whose name matches an existing tool is skipped rather than overwritten. Guidance on when to use each tool, the tools that must be called first and pricing are not part of an OpenAPI document, and are set after the import.

For example, the operation below becomes a tool named create_booking, called with POST at /bookings, with its description taken from the summary, its input schema from the request body, its output schema from the 201 response and sign in required because the operation declares a security requirement.

openapi.json
{
"openapi": "3.0.3",
"info": { "title": "Bookings API", "version": "1.0.0" },
"components": {
"securitySchemes": {
"bearerAuth": { "type": "http", "scheme": "bearer" }
}
},
"paths": {
"/bookings": {
"post": {
"operationId": "create_booking",
"summary": "Reserves the selected service for the signed in customer at the requested time and returns the confirmed booking.",
"security": [{ "bearerAuth": [] }],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["service_id", "start_time"],
"properties": {
"service_id": {
"type": "string",
"description": "The identifier of the service being booked."
},
"start_time": {
"type": "string",
"format": "date-time",
"description": "The start of the booking, in ISO 8601 format."
},
"notes": {
"type": "string",
"description": "Any requirements the customer has asked to pass on."
}
}
}
}
}
},
"responses": {
"201": {
"description": "The confirmed booking.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"booking_id": { "type": "string" },
"status": { "type": "string", "enum": ["confirmed"] },
"start_time": { "type": "string", "format": "date-time" }
}
}
}
}
}
}
}
}
}
}

Write each summary as a complete description of what the operation does, since it becomes the description agents read. The more complete your summaries and field descriptions, the less you need to add after the import.

Importing your document

1

Import the document

Under Tools in the Agents area of the Mitu dashboard, select Import OpenAPI and provide your OpenAPI 3 document in JSON format. A tool is created for each operation it describes, saved as a draft so that nothing reaches agents until you publish.

2

Remove what agents should not reach

Most API documents describe far more than agents should be able to do, including administrative, maintenance and internal operations. Remove every tool that does not serve a customer need, so agents are presented with a focused set of actions.

3

Add guidance for agents

For each tool you keep, add When to use guidance and any tools that must be called first, and rename any tool whose operation identifier would be unclear to an agent. This is the step that most improves how accurately agents use your service.

4

Set access and pricing

Decide which tools require a signed in customer, and set a price for any you charge for, using the settings described in Add tools and Pricing.

5

Publish and test

Publish your tools with your instructions, then call each one from an AI app to confirm that the agent selects it at the right moment and sends a valid request.

Keeping tools aligned with your API

  1. Treat your document as the contract
    When an operation changes, update your OpenAPI document first, then review the affected tools so their schemas match what your API accepts.
  2. Write descriptions that serve both audiences
    Clear summaries and parameter descriptions in your OpenAPI document improve both your developer documentation and the tools created from it.
  3. Review before you publish
    Imported tools arrive as drafts and reach agents only when you publish, so review and describe each one first.

Importing from OpenAPI lets you build on the description of your API you already maintain, rather than recreating it. Combined with the guidance you add for agents, it produces a set of tools that is technically accurate from the outset and shaped around how your customers actually use your business.