|
cMCP 0.4.1
Model Context Protocol library in pure C11
|
JSON Schema validator for tool inputs. More...
#include "cmcp_json.h"Go to the source code of this file.
Data Structures | |
| struct | cmcp_schema_error_t |
Functions | |
| void | cmcp_schema_error_init (cmcp_schema_error_t *e) |
| void | cmcp_schema_error_clear (cmcp_schema_error_t *e) |
| int | cmcp_schema_validate (const cmcp_json_t *schema, const cmcp_json_t *value, cmcp_schema_error_t *err) |
| cmcp_json_t * | cmcp_schema_error_to_json (const cmcp_schema_error_t *e) |
JSON Schema validator for tool inputs.
cMCP's tools/call handler validates the incoming arguments object against the tool's declared inputSchema before dispatch. Validator surface near-parity with Ajv (the JSON Schema implementation the TypeScript MCP SDK uses); see docs/schema-conformance.md for the full keyword list and the documented deliberate departures (regex flavour, integer-vs-number distinction). Failures surface to the peer as JSON-RPC error -32602 with structured {path, keyword, message} data.
Definition in file cmcp_schema.h.
| void cmcp_schema_error_init | ( | cmcp_schema_error_t * | e | ) |
| void cmcp_schema_error_clear | ( | cmcp_schema_error_t * | e | ) |
| int cmcp_schema_validate | ( | const cmcp_json_t * | schema, |
| const cmcp_json_t * | value, | ||
| cmcp_schema_error_t * | err | ||
| ) |
| cmcp_json_t * cmcp_schema_error_to_json | ( | const cmcp_schema_error_t * | e | ) |