MCP Gateway
ApiMcp servers

AI-assisted schema correction

Use AI to validate and correct a tool's JSON Schema. Accepts an optional request body with user-provided schema and prompt. When no body is sent, falls back to the tool's effective schema from the DB. Returns corrected schema with explanation of changes. Returns 503 if no LLM provider is configured.

POST
/api/v1/servers/{server_id}/tools/{tool_id}/correct-schema

Path Parameters

server_id*string
Formatuuid
tool_id*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://loading/api/v1/servers/497f6eca-6276-4993-bfeb-53cbbbba6f08/tools/497f6eca-6276-4993-bfeb-53cbbbba6f08/correct-schema" \  -H "Content-Type: application/json" \  -d '{}'
{
  "corrected_schema": {},
  "explanation": "string",
  "changes_made": [
    "string"
  ]
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}