Class JsonSchemaUtils

java.lang.Object
dev.tachyonmcp.core.server.json.JsonSchemaUtils

@InternalApi public class JsonSchemaUtils extends Object
  • Method Details

    • validateSchemaRoot

      public static void validateSchemaRoot(JsonSchemaFactory<String> factory, String schemaKind, String toolName, @Nullable JsonSchema schema)
      Validates that a tool schema is well-formed JSON with an object root declaring "type": "object".
      Parameters:
      factory - parses and validates the schema's raw JSON
      schemaKind - the kind of schema being validated
      toolName - the name of the tool owning the schema
      schema - the schema to validate, or null
      Throws:
      IllegalArgumentException - if the schema is not valid JSON, or its root is invalid
    • validateArguments

      public static @Nullable String validateArguments(JsonSchemaValidator validator, @Nullable JsonSchema schema, @Nullable Map<String,tools.jackson.databind.JsonNode> args)
      Validates args against schema; returns a joined error message, or null when valid / no schema.