Development
Validate a real API response JSON against the response schema declared in an OpenAPI 3.x specification
Call this tool from your code in three languages.
curl -X POST 'https://api.elysiatools.com/en/api/tools/api-response-contract-validator' \
-H 'Content-Type: application/json' \
-d '{"openApiSpec":"openapi: 3.0.3\npaths:\n /users/{id}:\n get:\n responses:\n \"200\":\n description: ok\n content:\n application/json:\n schema:\n type: object\n required: [id, name]\n properties:\n id: { type: integer }\n name: { type: string }\n active: { type: boolean }","responseJson":"{\"id\":\"1\",\"active\":\"yes\"}","path":"/users/42","method":"get","statusCode":"200","specFormat":"yaml","disallowAdditionalProperties":true}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/api-response-contract-validator| Name | Type | Required | Description |
|---|---|---|---|
| openApiSpec | textarea | Yes | — |
| responseJson | textarea | Yes | — |
| path | text | Yes | — |
| method | select | No | — |
| statusCode | text | Yes | — |
| specFormat | select | No | — |
| disallowAdditionalProperties | checkbox | No | — |
HTML result
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-api-response-contract-validator": {
"name": "api-response-contract-validator",
"description": "Validate a real API response JSON against the response schema declared in an OpenAPI 3.x specification",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=api-response-contract-validator",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "api-response-contract-validator",
"arguments": {
"openApiSpec": "openapi: 3.0.3\npaths:\n /users/{id}:\n get:\n responses:\n \"200\":\n description: ok\n content:\n application/json:\n schema:\n type: object\n required: [id, name]\n properties:\n id: { type: integer }\n name: { type: string }\n active: { type: boolean }",
"responseJson": "{\"id\":\"1\",\"active\":\"yes\"}",
"path": "/users/42",
"method": "get",
"statusCode": "200",
"specFormat": "yaml",
"disallowAdditionalProperties": true
}
}
}Questions or issues? Contact [email protected]