# Tool Schema Converter (`skilled_glee/tool-schema-converter`) Actor

Transform tool schemas between Echo and a pinned MCP profile for AI tools and agents, reporting invalid source contracts and every supported information loss. A developer tool for conversion, not execution.

- **URL**: https://apify.com/skilled_glee/tool-schema-converter.md
- **Developed by:** [EchoEmpire Machine Foundry (EchoEmpire LLC)](https://apify.com/skilled_glee) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 33.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 schema converteds

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

## Tool Schema Converter: MCP, OpenAI, Anthropic

Convert tool schemas between MCP, OpenAI, Anthropic, Gemini and OpenAPI formats. Lossless where possible, with warnings where not.

Validation and conversion are pure code. No LLM, no network, and no proxy. A description is never invented.

### Input

| Field | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `tools` | array (1–500), or an envelope object | sample `get_weather` tool | no (omitted uses the sample) | Tool definitions. Also accepts an MCP `tools/list` response or `{ "tools": [...] }`. |
| `sourceFormat` | `auto` | `mcp` | `openai` | `anthropic` | `gemini` | `openapi` | `auto` | no | `auto` detects each tool individually. |
| `targetFormat` | `mcp` | `openai` | `anthropic` | `gemini` | `openapi` | `mcp` | no (omitted uses `mcp`) | Format of the converted output. |

If `tools` is omitted, a sample tool is used. If `targetFormat` is omitted, it defaults to `mcp`. An empty input `{}` and the Store prefill therefore both succeed. If `tools` is explicitly null, not an array (after unwrap), empty, or contains a non-object item, or `targetFormat` is explicitly invalid, the run fails with a clean input error, writes no dataset items, and charges no events.

#### Input example

```json
{
  "tools": [
    {
      "name": "get_weather",
      "description": "Get current weather for a city.",
      "inputSchema": {
        "type": "object",
        "properties": { "city": { "type": "string", "description": "City name" } },
        "required": ["city"]
      }
    }
  ],
  "sourceFormat": "auto",
  "targetFormat": "openai"
}
```

### Output

The dataset has one item per tool plus one summary item. The summary is also stored as the `OUTPUT` record.

Per-tool item:

- `index`, `originalName`, `name`, `sourceFormat`, `targetFormat`
- `converted`: the tool in the target format, or `null` when status is `failed`
- `warnings[]`: `{ "code", "path", "message" }`
- `lossless`: `true` only when there are no warnings
- `status`: `converted` | `partial` | `failed`

### Pricing

Pay per event: **`schema-converted` at $0.001** per tool.

It charges **only** for tools that were converted or converted-with-warnings (`converted` or `partial`). There is **no charge** for `failed` items, and no charge for runs rejected at input validation. Batch runs honor `maxTotalChargeUsd` and stop with `truncatedByChargeLimit` when the cap is hit.

Default run size is 256 MB.

### Privacy

This Actor uses limited permissions. It does not call the network; it only rewrites the definitions you pass in.

# Actor input Schema

## `tools` (type: `array,object,string,integer,number,boolean`):

Array of 1-500 tool definitions (MCP, OpenAI, Anthropic, Gemini, or OpenAPI). Also accepts an MCP tools/list response ({"result":{"tools":\[...]}}) or {"tools":\[...]}. If omitted, a sample get_weather tool is used so an empty input can succeed.

## `sourceFormat` (type: `string`):

Format of the input tools. 'auto' detects each tool individually.

## `targetFormat` (type: `string`):

Format of the converted output. Defaults to mcp when omitted so the Store prefill and an empty input both succeed. Explicit invalid values are still rejected.

## Actor input object example

```json
{
  "tools": [
    {
      "name": "get_weather",
      "description": "Get current weather for a city.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "city": {
            "type": "string",
            "description": "City name"
          }
        },
        "required": [
          "city"
        ]
      }
    }
  ],
  "sourceFormat": "auto",
  "targetFormat": "mcp"
}
```

# Actor output Schema

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

One item per tool processed, plus one summary item.

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

Run summary: toolsProcessed, converted, partial, failed, charged, truncatedByChargeLimit.

# 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 = {
    "tools": [
        {
            "name": "get_weather",
            "description": "Get current weather for a city.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "city": {
                        "type": "string",
                        "description": "City name"
                    }
                },
                "required": [
                    "city"
                ]
            }
        }
    ],
    "targetFormat": "mcp"
};

// Run the Actor and wait for it to finish
const run = await client.actor("skilled_glee/tool-schema-converter").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 = {
    "tools": [{
            "name": "get_weather",
            "description": "Get current weather for a city.",
            "inputSchema": {
                "type": "object",
                "properties": { "city": {
                        "type": "string",
                        "description": "City name",
                    } },
                "required": ["city"],
            },
        }],
    "targetFormat": "mcp",
}

# Run the Actor and wait for it to finish
run = client.actor("skilled_glee/tool-schema-converter").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 '{
  "tools": [
    {
      "name": "get_weather",
      "description": "Get current weather for a city.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "city": {
            "type": "string",
            "description": "City name"
          }
        },
        "required": [
          "city"
        ]
      }
    }
  ],
  "targetFormat": "mcp"
}' |
apify call skilled_glee/tool-schema-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,skilled_glee/tool-schema-converter"
        }
    }
}
```

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/233uXxtmCdkwRefxW/builds/1De3JPoBqWFUY3UFv/openapi.json
