OpenAPI¶
The OpenAPI tool lets agents call pre-selected operations from an HTTP API described by an OpenAPI specification. Each selected operation is available to the agent as a separate tool.
For example, use this tool to let an agent retrieve or update information in an external business application that exposes an OpenAPI specification.
Prerequisites¶
Create an OpenAPI connection for the API. The connection defines the API server URL, authentication, and network-related settings.
When the connection uses per-user authentication, users must provide or authorize their credentials before an agent can call the API on their behalf.
Configuration¶
Create a tool of type OpenAPI, then select the OpenAPI connection to use. Provide an OpenAPI 3.x or Swagger 2.0 specification by loading it from a URL, or by uploading a JSON or YAML file.
From the operations defined by the specification, select the ones to make available to agents. For each operation, you can customize the name, description, input descriptions and hide optional inputs that agents do not need to provide.
The tool supports GET, POST, PUT, DELETE, and PATCH operations. It supports path, query, and header parameters. Request bodies must use JSON, application/x-www-form-urlencoded or multipart/form-data bodies are not supported.
Usage¶
Add the OpenAPI tool to an agent. The agent sees each selected API operation as a regular standalone tool and can select an operation based on its name, description, and inputs.