request_validator.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. """
  2. -----------------------------------------------------------------------------------------
  3. INTERSEL - 4 cité d'Hauteville - 75010 PARIS
  4. RCS PARIS 488 379 660 - NAF 721Z
  5. File : mcp/request_validator.py
  6. Object : Request validator for the MCP server
  7. -----------------------------------------------------------------------------------------
  8. Modifications :
  9. - 2026/01/16 - Damien Lugagne-Delpon - V1.0.0- Creation
  10. -----------------------------------------------------------------------------------------
  11. @copyright : Intersel 2026
  12. @author : Damien Lugagne-Delpon - damien.lugagne-delpon@livinweb.fr
  13. @version : 1.0.0 (to be updated to the current_version of the developed software if file is touched)
  14. -----------------------------------------------------------------------------------------
  15. """
  16. class RequestValidator:
  17. """Request validator for the MCP server."""
  18. def __init__(self):
  19. """Initialize the request validator."""
  20. self.schema = REQUEST_SCHEMA
  21. def validate(self, request_data: dict) -> bool:
  22. """Validate the incoming request data.
  23. Args:
  24. request_data (dict): The incoming request data.
  25. Returns:
  26. bool: If the request is valid.
  27. """
  28. tool = request_data.get("tool")
  29. parameters = request_data.get("parameters")
  30. return True
  31. REQUEST_SCHEMA = {
  32. "tool": str,
  33. "parameters": dict
  34. }