validate_mcp_response
Validate that an MCP tool response conforms to expected format, schema, and content rules. Use this to QA-test any MCP server tool. Supply the tool's actual JSON result and a set of checks to perform.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"response": "{\"user\":{\"name\":\"x\"}}",
"forbidden_keys": "password"
},
"name": "validate_mcp_response"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| response | Yes | The MCP tool result as a JSON string to validate | |
| min_items | No | If response is an array, minimum number of items expected | |
| expected_type | No | Expected top-level type: "object", "array", "string", "number" | |
| required_keys | No | Comma-separated list of keys that MUST exist in the response (dot-notation for nested: "data.id, data.name") | |
| actual_latency | No | Actual measured latency in ms (from the call) | |
| forbidden_keys | No | Comma-separated list of keys that MUST NOT exist (e.g. "password, secret, token") | |
| max_size_bytes | No | Maximum acceptable response size in bytes | |
| max_response_ms | No | Maximum acceptable latency in ms (will be compared if provided) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total | No | ||
| checks | No | ||
| failed | No | ||
| passed | No | ||
| verdict | No |