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
4 changed files with 103 additions and 29 deletions

View file

@ -2,7 +2,7 @@
"content": [
{
"type": "text",
"text": "{\n \"success\": true,\n \"message\": \"Event \\\"Project Deadline\\\" scheduled successfully for \\\"2024-12-15\\\".\",\n \"event_details\": {\n \"title\": \"Project Deadline\",\n \"date\": \"2024-12-15\",\n \"type\": \"reminder\",\n \"time\": \"All day\",\n \"priority\": \"Normal\",\n \"attendees\": [],\n \"invites_will_be_sent\": false\n }\n}"
"text": "{\n \"success\": true,\n \"message\": \"Event \\\"Project Deadline\\\" scheduled successfully for \\\"2024-12-15\\\".\",\n \"event_details\": {\n \"title\": \"Project Deadline\",\n \"date\": \"2024-12-15\",\n \"type\": \"reminder\",\n \"time\": \"All day\",\n \"priority\": \"High\",\n \"attendees\": [],\n \"invites_will_be_sent\": false\n }\n}"
}
],
"structuredContent": {
@ -13,7 +13,7 @@
"date": "2024-12-15",
"type": "reminder",
"time": "All day",
"priority": "Normal",
"priority": "High",
"attendees": [],
"invites_will_be_sent": false
}

View file

@ -2,7 +2,7 @@
"content": [
{
"type": "text",
"text": "{\n \"success\": true,\n \"message\": \"Event \\\"Client Call\\\" scheduled successfully for \\\"2024-12-02\\\".\",\n \"event_details\": {\n \"title\": \"Client Call\",\n \"date\": \"2024-12-02\",\n \"type\": \"call\",\n \"time\": \"14:30\",\n \"priority\": \"Normal\",\n \"attendees\": [\n \"client@example.com\"\n ],\n \"invites_will_be_sent\": false\n }\n}"
"text": "{\n \"success\": true,\n \"message\": \"Event \\\"Client Call\\\" scheduled successfully for \\\"2024-12-02\\\".\",\n \"event_details\": {\n \"title\": \"Client Call\",\n \"date\": \"2024-12-02\",\n \"type\": \"call\",\n \"time\": \"14:30\",\n \"priority\": \"High\",\n \"attendees\": [\n \"client@example.com\"\n ],\n \"invites_will_be_sent\": false\n }\n}"
}
],
"structuredContent": {
@ -13,7 +13,7 @@
"date": "2024-12-02",
"type": "call",
"time": "14:30",
"priority": "Normal",
"priority": "High",
"attendees": [
"client@example.com"
],

View file

@ -2,7 +2,7 @@
"content": [
{
"type": "text",
"text": "{\n \"success\": true,\n \"message\": \"Event \\\"Office Party\\\" scheduled successfully for \\\"2024-12-20\\\".\",\n \"event_details\": {\n \"title\": \"Office Party\",\n \"date\": \"2024-12-20\",\n \"type\": \"other\",\n \"time\": \"18:00\",\n \"priority\": \"Normal\",\n \"attendees\": [\n \"team@company.com\"\n ],\n \"invites_will_be_sent\": true\n }\n}"
"text": "{\n \"success\": true,\n \"message\": \"Event \\\"Office Party\\\" scheduled successfully for \\\"2024-12-20\\\".\",\n \"event_details\": {\n \"title\": \"Office Party\",\n \"date\": \"2024-12-20\",\n \"type\": \"other\",\n \"time\": \"18:00\",\n \"priority\": \"Low\",\n \"attendees\": [\n \"team@company.com\"\n ],\n \"invites_will_be_sent\": true\n }\n}"
}
],
"structuredContent": {
@ -13,7 +13,7 @@
"date": "2024-12-20",
"type": "other",
"time": "18:00",
"priority": "Normal",
"priority": "Low",
"attendees": [
"team@company.com"
],

View file

@ -33,13 +33,13 @@
"default": null
},
"priority": {
"type": "integer",
"type": "string",
"description": "The priority of the event. Defaults to Normal.",
"default": 1,
"default": "normal",
"enum": [
0,
1,
2
"low",
"normal",
"high"
]
},
"attendees": {