Tool Definition Repair & Converter for AI Agents avatar

Tool Definition Repair & Converter for AI Agents

Pricing

$1.50 / 1,000 tool processeds

Go to Apify Store
Tool Definition Repair & Converter for AI Agents

Tool Definition Repair & Converter for AI Agents

An AI tool for agents and developers that repairs broken AI-agent tool definitions and converts between MCP, OpenAI and Anthropic formats, with a change log. Every repaired tool is rechecked with Tool Contract Validator rules. Pure code: no LLM, no network.

Pricing

$1.50 / 1,000 tool processeds

Rating

0.0

(0)

Developer

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Features

Limited permissions

Share

Takes AI-agent tool definitions that are broken or in the wrong format and returns fixed, ready-to-use versions plus a log of every change. It is the partner to Tool Contract Validator for AI Agents: that Actor finds the problems, and this one fixes the ones that can be fixed safely without guessing.

Validation and repair are pure code. No LLM, no network, and no proxy. A description or a property is never invented. After each repair, the output is re-checked with the same contract rules as the validator, so a repaired result is always valid.

Input

FieldTypeDefaultRequiredDescription
toolsarray (1–500), or an envelope object—yesTool definitions. Also accepts an MCP tools/list response or { "tools": [...] }.
sourceFormatauto | mcp | openai | anthropicautonoauto detects each tool individually.
targetFormatsame | mcp | openai | anthropicsamenosame keeps each tool's source format. Otherwise converts the wrapper to MCP (inputSchema), OpenAI (parameters), or Anthropic (input_schema).
modesafe | aggressivesafenoSafe mode makes only lossless fixes. Aggressive mode also drops required keys that are not defined and removes $refs it cannot resolve.

If tools is missing, not an array (after unwrap), empty, or contains a non-object item, the run fails with a clean input error, writes no dataset items, and charges no events.

Input example

This is a broken MCP tool (name with a space, typo strng, string required, missing root type, extra whitespace in the description):

{
"tools": [
{
"name": "get weather",
"description": " Get current weather. ",
"inputSchema": {
"properties": {
"city": { "type": "strng", "description": "City name" }
},
"required": "city"
}
}
],
"sourceFormat": "auto",
"targetFormat": "same",
"mode": "safe"
}

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
  • repaired: the fixed tool definition in the target format, or null when status is failed
  • changes[]: { "code", "path", "before", "after" }
  • unfixable[]: { "code", "path", "message" }
  • status: unchanged | repaired | partial | failed

Summary item:

  • type: "summary"
  • toolsProcessed, unchanged, repaired, partial, failed

Output example

For the input example above (safe mode, same format):

[
{
"index": 0,
"originalName": "get weather",
"name": "get_weather",
"status": "repaired",
"changes": [
{ "code": "NAME_SANITIZED", "path": "/name", "before": "get weather", "after": "get_weather" },
{ "code": "DESCRIPTION_TRIMMED", "path": "/description", "before": " Get current weather. ", "after": "Get current weather." },
{ "code": "ROOT_TYPE_ADDED", "path": "/inputSchema/type", "before": null, "after": "object" },
{ "code": "TYPE_CORRECTED", "path": "/inputSchema/properties/city/type", "before": "strng", "after": "string" },
{ "code": "REQUIRED_TO_ARRAY", "path": "/inputSchema/required", "before": "city", "after": ["city"] }
],
"unfixable": [],
"repaired": {
"name": "get_weather",
"description": "Get current weather.",
"inputSchema": {
"type": "object",
"properties": {
"city": { "type": "string", "description": "City name" }
},
"required": ["city"]
}
}
},
{
"type": "summary",
"toolsProcessed": 1,
"unchanged": 0,
"repaired": 1,
"partial": 0,
"failed": 0
}
]

The summary may also include run metadata such as charged, sourceFormat, targetFormat, mode, and durationMs.

What is repaired

  • Clean up names: replace characters that are not A–Z, a–z, 0–9, _, or - with _, cut to 64 characters, and add _2, _3, and so on to duplicates.
  • Fix the wrapper field for the target format (inputSchema, parameters, or input_schema).
  • Add a missing root type: "object", and add an empty properties object when it is missing.
  • Correct common type typos and aliases (strng / str → string, int → integer, bool → boolean, float / double → number).
  • Turn a string required into an array and remove duplicate entries.
  • Drop empty enum arrays.
  • Inline local $refs that resolve.
  • Trim whitespace around names and descriptions.
  • Never invent a description or a property. Missing ones are reported as unfixable in safe mode (status is partial).
  • After repairing, re-check each output with the same rules as Tool Contract Validator, so a repaired result is always valid.

In aggressive mode, undefined required keys are dropped and unresolvable $refs are removed, which can turn a partial result into repaired when the rest of the contract is valid.

Pricing

Pay per event: tool-processed at $0.0015 per tool.

It charges only for tools whose output passes the recheck: status unchanged or repaired. There is no charge for partial or failed items, and no charge for runs rejected at input validation.

The Actor's default run size is 256 MB.

Limits

  • 1 to 500 tool definitions per run
  • Default timeout 60 seconds, default memory 256 MB

Privacy

This Actor uses limited permissions. It does not call the network to fetch or execute tools; it only inspects and rewrites the definitions you pass in.