OpenAPI Agent
OpenAPI Agent works with a web service through its OpenAPI specification, the document that describes which addresses the service has and what data each one accepts. You upload that document, ask for something in your own words (“list the pending orders”) and the agent checks the specification, decides which calls to make, runs them and answers with what it gets back.
It can make read calls and also calls that create, change and delete data. It does not add keys or credentials to the calls, so it only works with services that do not require authentication. It is an older component kept for compatibility with existing flows.
When to use it
- Querying an internal or public service that publishes its OpenAPI specification, in plain language.
- Trying out what a web service can do without writing the calls by hand.
Configuration
| Connection | What to connect |
|---|---|
| Model (required) | The AI model that interprets the request, reads the specification and decides on the calls. |
| Field | What it does |
|---|---|
| Input | What you want to do or look up, usually from Chat Input. |
| File Path (required) | The service’s OpenAPI specification. It accepts .json, .yaml and .yml files. |
| Allow Dangerous Requests (required) | Allows the agent to make real calls to the service. It must be on for the agent to work. Default: off. |
Advanced options
| Field | What it does |
|---|---|
| Handle Parse Errors | If the model returns an answer in an unexpected format, the agent tries to recover instead of stopping. Default: on. |
| Verbose | Logs the agent’s steps in detail. Default: on. |
| Max Iterations | The maximum number of steps (lookups in the specification and calls) before stopping. Default: 15. |
Using it as an agent tool
You can connect this component to an agent’s Tools input. In the Tool tab, Tool Name and Tool Description are the name and explanation the agent uses to recognise the tool and decide when to call it: write a clear description of what it does.
Output
- Response: the answer as a message. Connect it to Chat Output or to any component that takes text.
- Agent: the configured agent, to connect it to components that take an agent.
Example
The IT team of the bookshop chain Página Uno has an internal stock service, without authentication, that publishes its OpenAPI specification:
- Upload the specification in File Path.
- Connect an AI model to Model and Chat Input to Input.
- Turn on Allow Dangerous Requests.
- Connect Response to Chat Output.
- From the chat, ask: “How many copies of the book with reference 4410 are left in the Seville shop?”.
The agent finds the stock lookup in the specification, runs it and answers with the copies available.
Good practices
- Only use it with services where nothing serious happens if the agent creates, changes or deletes data, or with services that only allow reading.
- For services that require credentials, use a dedicated component or API Request.
Related components
- API Request: makes a specific call to a web service.
- Agent: NappAI’s main agent.