Agency allows you to easily convert OpenAPI schemas into tools so your agents can interact with any external APIs. For example, by adding the Google Calendar API schema, your agent will be able to create, update, delete, and retrieve events from Google Calendar.Documentation Index
Fetch the complete documentation index at: https://agency-swarm.ai/llms.txt
Use this file to discover all available pages before exploring further.
How to Find OpenAPI Schemas
The recommended way to create OpenAPI schemas is to use Actions GPT. Simply ask it to create a schema for the API you want to use and which actions you want to perform. If your API is public and well known, it should be able to create a schema for you on the first try, without any extra documentation.How to Use OpenAPI Schemas
Below are the two ways to use OpenAPI schemas in your agents:Option 1: Using the schemas_folder
The first way to integrate OpenAPI schemas is by placing all your OpenAPI schema files in a folder, and then initializing your agent with the schemas_folder parameter. Agency Swarm will then automatically scan this folder and convert any OpenAPI schemas it finds into BaseTool instances.
schemas_folder: Directory where your OpenAPI schema files are stored.api_params: Extra parameters for specific schemas.api_headers: Custom headers for API calls, like authentication tokens.
Option 2: Using the ToolFactory Class
Alternatively, you can use theToolFactory class to convert OpenAPI schemas from local files or URLs.
Converting from a Local Schema File
Converting from a Local Schema File
Converting from a Remote Schema URL
Converting from a Remote Schema URL
schema: The OpenAPI schema to convert.headers: HTTP headers applied to every request generated from the schema. For per-file mappings when usingAgent(schemas_folder=...), pass them via the agent’sapi_headersargument.params: Query parameters appended to every request generated from the schema.strict: Whether to use strict OpenAI mode.
tools list to your agent:
ToolConfig of each tool. See the ToolConfig documentation for more information.
With any of these methods, Agency still converts your schemas into PyDantic models, so your agents will perform type checking on all API parameters before making API calls, reducing errors and improving reliability.