1818 InMemoryQueueManager ,
1919 QueueManager ,
2020)
21- from a2a .server .request_handlers .request_handler import RequestHandler
21+ from a2a .server .request_handlers .request_handler import (
22+ RequestHandler ,
23+ validate_request_params ,
24+ )
2225from a2a .server .tasks import (
2326 PushNotificationConfigStore ,
2427 PushNotificationEvent ,
@@ -118,6 +121,7 @@ def __init__( # noqa: PLR0913
118121 # asyncio tasks and to surface unexpected exceptions.
119122 self ._background_tasks = set ()
120123
124+ @validate_request_params
121125 async def on_get_task (
122126 self ,
123127 params : GetTaskRequest ,
@@ -133,6 +137,7 @@ async def on_get_task(
133137
134138 return apply_history_length (task , params )
135139
140+ @validate_request_params
136141 async def on_list_tasks (
137142 self ,
138143 params : ListTasksRequest ,
@@ -154,6 +159,7 @@ async def on_list_tasks(
154159
155160 return page
156161
162+ @validate_request_params
157163 async def on_cancel_task (
158164 self ,
159165 params : CancelTaskRequest ,
@@ -317,6 +323,7 @@ async def _send_push_notification_if_needed(
317323 ):
318324 await self ._push_sender .send_notification (task_id , event )
319325
326+ @validate_request_params
320327 async def on_message_send (
321328 self ,
322329 params : SendMessageRequest ,
@@ -386,6 +393,7 @@ async def push_notification_callback(event: Event) -> None:
386393
387394 return result
388395
396+ @validate_request_params
389397 async def on_message_send_stream (
390398 self ,
391399 params : SendMessageRequest ,
@@ -474,6 +482,7 @@ async def _cleanup_producer(
474482 async with self ._running_agents_lock :
475483 self ._running_agents .pop (task_id , None )
476484
485+ @validate_request_params
477486 async def on_create_task_push_notification_config (
478487 self ,
479488 params : TaskPushNotificationConfig ,
@@ -499,6 +508,7 @@ async def on_create_task_push_notification_config(
499508
500509 return params
501510
511+ @validate_request_params
502512 async def on_get_task_push_notification_config (
503513 self ,
504514 params : GetTaskPushNotificationConfigRequest ,
@@ -530,6 +540,7 @@ async def on_get_task_push_notification_config(
530540
531541 raise InternalError (message = 'Push notification config not found' )
532542
543+ @validate_request_params
533544 async def on_subscribe_to_task (
534545 self ,
535546 params : SubscribeToTaskRequest ,
@@ -572,6 +583,7 @@ async def on_subscribe_to_task(
572583 async for event in result_aggregator .consume_and_emit (consumer ):
573584 yield event
574585
586+ @validate_request_params
575587 async def on_list_task_push_notification_configs (
576588 self ,
577589 params : ListTaskPushNotificationConfigsRequest ,
@@ -597,6 +609,7 @@ async def on_list_task_push_notification_configs(
597609 configs = push_notification_config_list
598610 )
599611
612+ @validate_request_params
600613 async def on_delete_task_push_notification_config (
601614 self ,
602615 params : DeleteTaskPushNotificationConfigRequest ,
0 commit comments