# OpenAPI to Agent Tools: Spec to Tool List (`hydrocore/openapi-spec-to-agent-tools`) Actor

Turn an OpenAPI or Swagger spec URL into an agent-ready tool list: API title, version, servers, auth schemes, one row per operation with method, path, parameters, request body, suggested tool name and description, plus quality issues. JSON or YAML, OpenAPI 3.x and Swagger 2.0.

- **URL**: https://apify.com/hydrocore/openapi-spec-to-agent-tools.md
- **Developed by:** [Hydrocore Data](https://apify.com/hydrocore) (community)
- **Categories:** Developer tools, AI, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.40 / 1,000 api spec analyzeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## OpenAPI to Agent Tools: Spec to Tool List, Auth & Quality Check

Turn any **OpenAPI 3.x or Swagger 2.0 spec URL (JSON or YAML)** into an **agent-ready tool list**. You get one summary row per spec (title, version, servers, **auth schemes**, operation, path and tag counts, **quality issues**, estimated tool tokens) and one flat row per operation with **method, path, a suggested snake_case tool name, a clean tool description, parameters, required parameters, request body types, response codes, deprecation and auth**. Use it to wrap an API as MCP or function-calling tools, to audit whether a spec is good enough for agents, or to document an API without reading 10,000 lines of YAML.

### ✅ What you get

- API title, version, spec version, servers and description
- Auth schemes (apiKey, http bearer or basic, oauth2, openIdConnect) and which operations they cover
- Method, path, operationId and a generated tool name
- Tool description from summary and description, trimmed to 500 characters
- Parameter names, required parameters, request body content types, response codes
- Deprecated operations, tags, operation, path and tag counts
- Quality issues and an estimated token size of the whole tool set

### 🏆 Why this Actor

- **Built for agent tool-building:** tool names are safe (letters, digits, underscore, max 64 characters) and descriptions are pre-trimmed, so they can be pasted into MCP or function-calling definitions.
- **Spec quality audit:** missing operationIds, missing descriptions, duplicate tool names, no servers or security schemes and oversized APIs are flagged in plain language.
- **Handles both worlds:** OpenAPI 3.0/3.1 and Swagger 2.0, JSON or YAML, local $ref parameters resolved, GitHub blob URLs converted to raw URLs.
- **Filter before you pay:** filter by tag, drop deprecated operations, sort and cap; filtered operations are never charged.
- **Flat, fixed JSON:** the same 33 keys on every row, missing values are null, plus a summaryText sentence for agents.

### 💡 Use cases

- AI engineers: generate MCP server or function-calling tool definitions from an existing API spec
- API teams: check how agent-friendly a public spec is before publishing it
- Integration agencies: list every operation, auth scheme and server of a vendor API in seconds
- Agents: read an API spec URL once and decide which endpoints to call
- Documentation and QA: spot deprecated or undocumented operations

### 🚀 How to use

1. Enter one or more **spec URLs** (openapi.json, swagger.json or openapi.yaml).
2. Optional: switch operation rows off, keep only some tags, drop deprecated operations, pick a sort and a cap.
3. Run, then open **Overview**, **Agent tools** or **Spec quality**, or call the Actor from an agent via the API or MCP.

### ⚙️ Input

| Field | What it does |
|---|---|
| `specUrls` | One OpenAPI or Swagger spec URL per line. GitHub blob URLs are converted to raw URLs. The prefilled example list is used when the input is empty. |
| `includeOperations` | On (default) saves one row per operation; off saves only the spec summary rows. |
| `tags` | Keep only operations with one of these tags (case-insensitive). |
| `includeDeprecated` | Off drops deprecated operations (not charged). |
| `sortBy` | document (spec order), path or method. Sorted before the cap. |
| `maxOperationsPerSpec` | Cap per spec after filtering and sorting (default 200, maximum 2000). |

Example input:

```json
{
  "specUrls": [
    "https://petstore3.swagger.io/api/v3/openapi.json"
  ],
  "tags": [
    "store"
  ],
  "sortBy": "path"
}
```

### ⬆️ Output

Spec rows (`recordType` = `spec`) and operation rows (`recordType` = `operation`) share one fixed set of 33 keys; keys that do not apply are `null`. Unreadable files, non-spec files and invalid URLs get a free row with `recordType` = `status`. The example is a real operation row from a test run of the current build.

Overview fields:

| Field | Type | Example | Description |
|---|---|---|---|
| `recordType` | string | "operation" | spec (one summary row per spec), operation (one row per API operation) or status (invalid URL, unreadable file or empty result; free). |
| `apiTitle` | string | "Swagger Petstore - OpenAPI 3.0" | info.title of the spec. |
| `method` | string | "GET" | HTTP method of the operation (GET, POST, ...). Null on spec rows. |
| `path` | string | "/pet/findByStatus" | URL path template of the operation. Null on spec rows. |
| `toolName` | string | "find_pets_by_status" | Agent-safe snake_case tool name (letters, digits, underscore; max 64 characters), from operationId or, if missing, method and path. |
| `toolDescription` | string | "Finds Pets by status. Multiple status values can be provide… | Summary plus description, clipped to 500 characters; falls back to "METHOD path". |
| `tags` | array | \["pet"] | Operation tags. Null when none. |
| `isDeprecated` | boolean | false | True when the operation is marked deprecated. |
| `operationCount` | integer | null | Number of operations in the spec. Spec rows only. |
| `issues` | array | null | Quality problems that hurt agent use: missing operationIds or descriptions, duplicate tool names, no servers or security, too many operations. Spec rows only; null when none. |

All 33 fields (in order): `recordType`, `specUrl`, `apiTitle`, `apiVersion`, `specVersion`, `method`, `path`, `operationId`, `toolName`, `toolDescription`, `summary`, `tags`, `parameterNames`, `requiredParameterNames`, `parameterCount`, `hasRequestBody`, `requestBodyTypes`, `responseCodes`, `isDeprecated`, `authSchemes`, `apiDescription`, `serverUrls`, `operationCount`, `pathCount`, `tagCount`, `deprecatedCount`, `missingDescriptionCount`, `missingOperationIdCount`, `toolTokensEstimate`, `issues`, `summaryText`, `inputValue`, `scrapedAt`.

Real row from a test run of the current build:

```json
{
  "recordType": "operation",
  "specUrl": "https://petstore3.swagger.io/api/v3/openapi.json",
  "apiTitle": "Swagger Petstore - OpenAPI 3.0",
  "apiVersion": "1.0.27",
  "specVersion": "openapi 3.0.4",
  "method": "GET",
  "path": "/pet/findByStatus",
  "operationId": "findPetsByStatus",
  "toolName": "find_pets_by_status",
  "toolDescription": "Finds Pets by status. Multiple status values can be provided with comma separated strings.",
  "summary": "Finds Pets by status",
  "tags": [
    "pet"
  ],
  "parameterNames": [
    "status"
  ],
  "requiredParameterNames": [
    "status"
  ],
  "parameterCount": 1,
  "hasRequestBody": false,
  "requestBodyTypes": null,
  "responseCodes": [
    "200",
    "400",
    "default"
  ],
  "isDeprecated": false,
  "authSchemes": [
    "petstore_auth (oauth2)"
  ],
  "apiDescription": null,
  "serverUrls": null,
  "operationCount": null,
  "pathCount": null,
  "tagCount": null,
  "deprecatedCount": null,
  "missingDescriptionCount": null,
  "missingOperationIdCount": null,
  "toolTokensEstimate": null,
  "issues": null,
  "summaryText": "GET /pet/findByStatus -> tool find_pets_by_status: Finds Pets by status. Multiple status values can be provided with comma separated strings.",
  "inputValue": "https://petstore3.swagger.io/api/v3/openapi.json",
  "scrapedAt": "2026-11-16T20:59:12.479Z"
}
```

Views: **Overview**, **Agent tools**, **Spec quality**, **Detailed (all fields)**. Export as JSON, CSV, Excel, XML or HTML from the Storage tab or the API (`/datasets/{id}/items?format=csv&view=overview`). The run summary (`OUTPUT` record in the key-value store) counts inputs, invalid URLs, duplicates, blocked hosts, fetch errors, non-spec files, specs analyzed, operations found, filtered, over the cap and operations saved, plus the filters and sort used.

### 💰 Pricing

Competitive pricing, pay per result: **$0.003 per spec** and **$0.0004 per operation** on the Free plan, less on higher plans, plus the $0.0005 Actor start. The default run (two example specs, 21 operations) costs about $0.0149; a 100-operation API costs about $0.044. Invalid URLs, unreadable files, non-spec files, duplicates, blocked hosts and filtered or over-the-cap operations are never charged.

| Event | What it is | Free | Bronze | Silver | Gold+ |
|---|---|---|---|---|---|
| API spec analyzed | One OpenAPI or Swagger spec read and summarized (title, version, servers, auth, operation, path and tag counts, quality issues, token estimate). Invalid URLs, unreadable files, non-spec files, duplicates and blocked hosts are free. | $0.003 | $0.0027 | $0.0025 | $0.0024 |
| API operation extracted | One API operation saved as an agent tool row (method, path, suggested tool name and description, parameters, body, responses, auth). Filtered, deprecated-excluded and over-the-cap operations are free. | $0.0004 | $0.00036 | $0.00034 | $0.00032 |
| Actor start | Once per run (Apify standard start event, per GB of memory; the default 256 MB = one fee) | $0.0005 | $0.0005 | $0.0005 | $0.0005 |

### 🔁 Integrations

Works with the Apify API, MCP (AI agents), Make, n8n, Zapier, Google Sheets and webhooks. Field names are stable camelCase, so mappings do not break between runs.

### ❓ FAQ

**Which spec formats are supported?**

OpenAPI 3.0 and 3.1 and Swagger 2.0, as JSON or YAML, up to 25 MB. GraphQL schemas, Postman collections and AsyncAPI are not supported.

**How are tool names generated?**

From operationId when present (camelCase becomes snake_case), otherwise from the method and path, for example GET /pets/{petId} becomes get_pets_by_pet_id. Names are lowercase letters, digits and underscores, up to 64 characters. Duplicates are reported in issues, not renamed.

**Does it call the API itself?**

No. It only reads the spec file. It never calls any endpoint described in it.

**Are $ref references resolved?**

Local references (#/components/...) are resolved for parameters, path items, request bodies and security schemes. Remote references to other files are not followed, and full schemas are not expanded; you get parameter names and body content types.

**What is the token estimate?**

The size of all suggested tool names, descriptions and parameter names, in characters divided by 4. It is a rough guide to how much context an API will use as agent tools.

**What if the spec has hundreds of operations?**

Filter by tag or cap the number of operations. Exposing hundreds of tools to one agent usually hurts tool selection, and the issues field warns when there are more than 100.

**Which auth schemes are shown?**

Every scheme in components.securitySchemes (or securityDefinitions) with its type, and per operation the schemes that apply from operation-level or global security.

**Why are some fields null on spec rows?**

Method, path, parameters and similar keys belong to operations. Counts and issues belong to specs. The shared row layout keeps every key in a fixed order.

**Can I analyze a private or localhost spec?**

No. Only public http(s) URLs are fetched; localhost and private network addresses are skipped for free.

**Is it good for AI agents?**

Yes. One URL in, flat rows out, with a ready tool name, a short description and a summaryText line per operation.

### 🛟 Support

Found a problem or need a field? Open an issue on the Issues tab; we read every issue.

### Changelog

- 1.0 (2026-11-16): first release.

# Actor input Schema

## `specUrls` (type: `array`):

One spec URL per line: a JSON or YAML OpenAPI 3.x or Swagger 2.0 file (for example https://petstore3.swagger.io/api/v3/openapi.json). GitHub blob URLs are converted to raw URLs. Duplicates are skipped for free. The prefilled example list is used when the input is empty.

## `includeOperations` (type: `boolean`):

On (default): one row per operation with a suggested tool name and description. Off: only one summary row per spec.

## `tags` (type: `array`):

Optional. Keep only operations that have at least one of these tags (case-insensitive), for example pets. Leave empty for all operations. Filtered operations are never charged.

## `includeDeprecated` (type: `boolean`):

Off drops operations marked deprecated: true (they are not charged).

## `sortBy` (type: `string`):

document keeps the order of the spec, path sorts by path then document order, method sorts by HTTP method then path. Sorting happens before the cap.

## `maxOperationsPerSpec` (type: `integer`):

Cap on operation rows per spec after filtering and sorting. Default 200, maximum 2000. Large APIs have hundreds of operations; filter by tag instead of exposing them all to an agent.

## Actor input object example

```json
{
  "specUrls": [
    "https://petstore3.swagger.io/api/v3/openapi.json",
    "https://raw.githubusercontent.com/OAI/learn.openapis.org/main/examples/v3.0/api-with-examples.yaml"
  ],
  "includeOperations": true,
  "includeDeprecated": true,
  "sortBy": "document",
  "maxOperationsPerSpec": 200
}
```

# Actor output Schema

## `overview` (type: `string`):

Spec summary or operation: method, path, tool name and description.

## `tools` (type: `string`):

Operations as agent tools: name, description, parameters and body.

## `specs` (type: `string`):

Spec-level counts and quality issues.

## `results` (type: `string`):

Every field for each row.

## `summary` (type: `string`):

Run summary: inputs, invalid URLs, duplicates, blocked hosts, fetch errors, non-spec files, specs analyzed, operations found, filtered, over the cap, operations saved and status rows.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "specUrls": [
        "https://petstore3.swagger.io/api/v3/openapi.json",
        "https://raw.githubusercontent.com/OAI/learn.openapis.org/main/examples/v3.0/api-with-examples.yaml"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hydrocore/openapi-spec-to-agent-tools").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "specUrls": [
        "https://petstore3.swagger.io/api/v3/openapi.json",
        "https://raw.githubusercontent.com/OAI/learn.openapis.org/main/examples/v3.0/api-with-examples.yaml",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("hydrocore/openapi-spec-to-agent-tools").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "specUrls": [
    "https://petstore3.swagger.io/api/v3/openapi.json",
    "https://raw.githubusercontent.com/OAI/learn.openapis.org/main/examples/v3.0/api-with-examples.yaml"
  ]
}' |
apify call hydrocore/openapi-spec-to-agent-tools --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hydrocore/openapi-spec-to-agent-tools"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/8mgFXy6wfrY0p2ZpN/builds/3e2X4tUhx46CvWhZ3/openapi.json
