integer('id')->description('ID of the task to retrieve.')->required(); } /** * Handle the tool request. */ public function handle(array $arguments): ToolResult { $id = (int) ($arguments['id'] ?? 0); $ticket = $this->ticketsService->getTicket($id); if ($ticket) { $formatter = new TicketFormatter($ticket); return ToolResult::text($formatter->format()); } return ToolResult::error("Could not find task with id {$id}"); } }