20 lines
643 B
Java
20 lines
643 B
Java
package mcp.tools.helper;
|
|
|
|
import io.modelcontextprotocol.spec.McpSchema;
|
|
import mcp.util.Result;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* Interface for validating tool queries (arguments) against a schema.
|
|
*/
|
|
public interface QueryValidator {
|
|
/**
|
|
* Validates the given arguments against the provided schema.
|
|
*
|
|
* @param schema The JSON schema to validate against.
|
|
* @param arguments The tool arguments to validate.
|
|
* @return A {@link Result} indicating success (Ok(null)) or failure (Err(exception)).
|
|
*/
|
|
Result<Void, Exception> validate(final McpSchema.JsonSchema schema, final Map<String, Object> arguments);
|
|
}
|