# OpenAPI to Agent Tools & Tool-Call Evals API (`solidscrape/openapi-toolkit-for-agents`) Actor

Convert OpenAPI JSON to MCP, Claude and OpenAI tool definitions. Get validated synthetic tool-call fixtures, schema fingerprints and a report of skipped endpoints.

- **URL**: https://apify.com/solidscrape/openapi-toolkit-for-agents.md
- **Developed by:** [SolidScrape](https://apify.com/solidscrape) (community)
- **Categories:** Developer tools, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 validated tool exporteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 MCP, Claude and OpenAI tool schemas

Give this Actor an OpenAPI JSON document your team owns or can process. It produces a catalog of API operations, tool definitions for three interfaces, and two synthetic argument fixtures for each exported tool. Use it to review an agent integration, prepare tool-calling evaluation data, or check how an API specification changed after a release.

#### Try the included example

[Open the prefilled issue tracker example](https://apify.com/solidscrape/openapi-toolkit-for-agents/examples/openapi-issue-tracker-to-agent-tools) to turn two API operations into tool schemas and argument tests.

Using Python? [Download the developer starter kit](https://api.apify.com/v2/key-value-stores/4RzLeqS1i9E9znTQC/records/solidscrape-ai-data-starter-kit-v1.zip?signature=Ke5Ew8SMdbluTC110rRe), then follow its guide to run `python run.py openapi`. The client sets a $0.02 cap per run.

Run with this input to compile two GET endpoints from an original, synthetic issue tracker. The launch price for this run is **$0.004**.

```json
{"methods":["GET"],"maxOperations":2,"maxSpendUsd":0.01}
```

The default dataset includes `GET /issues/{id}` under tool name `getIssue_1d38a7189b`. Its accepted fixture is `{"path":{"id":1}}`. Adding the undeclared root property `"__unexpected_argument__":true` creates the rejected fixture. Both outcomes are checked against the generated schema. These labels describe argument shape. They do not predict server responses, availability or model tool-selection accuracy.

To use your own document, set `spec` to the parsed JSON object. For example, paste a document in the **OpenAPI document** field in Console. Supply only contracts you have permission to process. Apify stores the submitted input with the run, so remove live credentials, private examples and secret server URLs before uploading. The Actor does not read remote specs or call target endpoints.

#### Use from a coding assistant or CI job

This Python example sends `openapi.json` to the Actor and prints one tool name and accepted argument example for each exported operation. Store your Apify token in your environment.

```python
import json, os, urllib.request
from pathlib import Path

spec = json.loads(Path("openapi.json").read_text(encoding="utf-8"))
endpoint = "https://api.apify.com/v2/acts/solidscrape~openapi-toolkit-for-agents/run-sync-get-dataset-items?memory=512&timeout=120&maxTotalChargeUsd=0.05"
payload = {"spec": spec, "methods": ["GET"], "maxOperations": 20, "maxSpendUsd": 0.05}
request = urllib.request.Request(endpoint, data=json.dumps(payload).encode(),
    headers={"Authorization": "Bearer " + os.environ["APIFY_TOKEN"], "Content-Type": "application/json"})
with urllib.request.urlopen(request, timeout=150) as response:
    for row in json.load(response):
        print(row["toolName"], row["fixtures"]["positive"]["arguments"])
```

For an asynchronous pipeline, POST the same input to the Actor's `/runs` endpoint, wait for `SUCCEEDED`, then read the default dataset and key-value store. Open **Output** in Console to download the JSON files directly.

| Output | Use |
| --- | --- |
| Dataset, **Agent tool catalog** view | One row per exported HTTP operation with method, path, input schema, transport bindings, response status codes and source document hash. |
| Dataset, **Tool-call evaluation fixtures** view | Accepted and rejected structural examples, their labels and the originating operation. |
| `MCP_TOOLS` | Array of MCP tool descriptions. Use as the tools array in your own server's list response. |
| `CLAUDE_TOOLS` | Tool definitions using Claude's `input_schema` shape. |
| `RESPONSES_TOOLS` | OpenAI Responses function definitions with `parameters` and `strict:false`. |
| `FINGERPRINTS` | Route-to-SHA256 map for comparing the next revision of the same API. |
| `SKIPPED` and `SUMMARY` | Visible conversion omissions, reasons, stop condition, source identity and modeled event charges. |

Developers supply their own tool handlers, trusted base URL, authentication, authorization and HTTP serialization. The output contains declarations and test data. Connecting a handler to a model allows calls only after you implement that integration. Review route and field metadata from external documents before exposing it to a model.

#### Why use this with an OpenAPI workflow?

Run the Actor on two revisions and pass the first run's `FINGERPRINTS` object as `previousFingerprints` to the second run. Each emitted operation is labeled `unchanged`, `changed` or `first_observed`. The fingerprint includes the generated name, input schema, transport and authentication binding metadata, security requirements and declared response codes. Review flagged changes before accepting them. Description-only changes can leave this fingerprint unchanged. It is an equality check on the exported interface, rather than a full breaking-change classifier. Missing routes can result from filters, limits or source omissions.

Teams already running FastMCP can build an executable server locally. This Actor serves teams that want a hosted conversion step, downloadable provider-specific JSON, explicit omissions and deterministic evaluation pairs without provisioning another service.

#### What the converter supports

- OpenAPI 3.0.x and 3.1.x **JSON objects** with an info title/version and paths. JSON only. Omit `spec` to use the bundled demo.
- GET operations by default. Include other uppercase methods explicitly. Compilation only inspects declarations.
- Local JSON Pointer references, path-level parameter inheritance and operation-level overrides. Path, query, header, cookie and JSON-body inputs occupy separate namespaces.
- Common typed objects, arrays, primitive enums, required fields, numeric bounds, lengths, item counts and nullable types. UUID, email, date, date-time, URI and numeric formats are retained as annotations. Structural checks do not validate field formats.
- Required read-only body properties are omitted from the request schema. Credential headers and declared API-key parameter names are emitted in `authBindings` for your transport layer. Source descriptions, examples and defaults are omitted from model-facing tool descriptions and synthetic examples. Schema enum values, parameter names and source metadata still come from the supplied document.
- External and cyclic references, composed or unspecified schema types, arbitrary regex patterns, complex dictionaries, path-item references, unsupported formats and multipart/binary bodies produce explicit omissions. Response status codes are listed, while response bodies are outside the exported interface.

Hard limits per run include 1 MB of input spec, 1,000 paths, 100 exported operations and a work allowance of three attempted operations per affordable requested export (250 attempts maximum). Rejected operations and invalid path items use this allowance. Conversion stops before the next attempt after six consecutive skips, or after a five-second soft deadline checked between operations. The current bounded operation can finish after that deadline. A budget that covers only startup produces zero conversion attempts. Each operation allows up to 400 schema nodes, nesting depth 12 and 32 KB of input schema. Total row output is bounded to approximately 1.5 MB. The summary reports the stop reason. A valid document may produce zero exports if filtering or supported-schema rules exclude every operation.

#### Pricing

At the supported 512 MB memory setting, a run starts at **$0.002**, then costs **$0.001 per operation exported**. Three provider formats and both fixtures are included. One tool costs $0.003, ten cost $0.012, and 100 cost $0.102. Skipped operations have no export fee. Invalid input or an empty export can still incur the automatic start fee.

Set `maxOperations` and `maxSpendUsd` for workload control and use Apify's maximum total charge for the platform limit. The smaller available budget determines output count. For example, exporting 100 operations needs a cap of at least $0.102. A run with an existing processing checkpoint refuses to replay work under that run ID.

#### Reference formats

[OpenAPI specification](https://spec.openapis.org/oas/v3.1.2.html) · [MCP tool declarations](https://modelcontextprotocol.io/specification/2025-11-25/server/tools) · [FastMCP OpenAPI integration](https://gofastmcp.com/integrations/openapi)

# Actor input Schema

## `spec` (type: `object`):

Paste OpenAPI 3.0.x or 3.1.x JSON up to 1 MB. Omit this field to try the included synthetic issue tracker. Remove secrets before uploading.

## `methods` (type: `array`):

Uppercase methods to include. GET is the default. POST, PUT, PATCH, DELETE, HEAD, OPTIONS and TRACE are opt-in metadata exports.

## `maxOperations` (type: `integer`):

Global cap on emitted records. Up to three attempts per affordable requested export, at most 250 attempts, six consecutive skips and a five-second soft conversion deadline.

## `maxSpendUsd` (type: `number`):

The smaller of this limit and the platform maximum applies. A 512 MB start costs $0.002, plus $0.001 per emitted tool.

## `previousFingerprints` (type: `object`):

Optional route-to-SHA256 map from FINGERPRINTS for the same API, up to 100 entries. Emitted rows label input ABI changes. Missing operations are not classified as removed.

## Actor input object example

```json
{
  "methods": [
    "GET"
  ],
  "maxOperations": 10,
  "maxSpendUsd": 0.05
}
```

# Actor output Schema

## `records` (type: `string`):

No description

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

No description

## `mcp_tools` (type: `string`):

No description

## `claude_tools` (type: `string`):

No description

## `responses_tools` (type: `string`):

No description

## `fingerprints` (type: `string`):

No description

## `skipped` (type: `string`):

No description

# 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 = {
    "methods": [
        "GET"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("solidscrape/openapi-toolkit-for-agents").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 = { "methods": ["GET"] }

# Run the Actor and wait for it to finish
run = client.actor("solidscrape/openapi-toolkit-for-agents").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 '{
  "methods": [
    "GET"
  ]
}' |
apify call solidscrape/openapi-toolkit-for-agents --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,solidscrape/openapi-toolkit-for-agents"
        }
    }
}
```

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/bw31hXv0XnOv87OVC/builds/fORjayKUDKwx8rjRO/openapi.json
