Use SchemaValidator to validate tool input (#203)

* Use SchemaValidator to validate tool input

* add test

* add changelog

* fix cs

* Improve error message

* fix tests

* fix tests

* fix baseline

* update snapshot files

* Remove BC compat while switching to v0.3.0

---------

Co-authored-by: Christopher Hertel <mail@christopher-hertel.de>
This commit is contained in:
Tobias Nyholm 2026-01-11 21:46:53 +01:00 • committed by GitHub
commit ed205ef793
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -91,9 +91,9 @@ class Error implements MessageInterface
return new self($id, self::METHOD_NOT_FOUND, $message);
}
public static function forInvalidParams(string $message, string|int $id = ''): self
public static function forInvalidParams(string $message, string|int $id = '', mixed $data = null): self
{
return new self($id, self::INVALID_PARAMS, $message);
return new self($id, self::INVALID_PARAMS, $message, $data);
}
public static function forInternalError(string $message, string|int $id = ''): self