integer('ticketId')->description('Ticket ID to stop the timer for. Omit to stop the active timer.'); } public function name(): string { return 'stopTimer'; } public function description(): string { return 'Stop a running timer.'; } /** * Handle the tool request. */ public function handle(array $arguments): ToolResult { $ticketId = ($arguments['ticketId'] ?? null); if ($ticketId !== null && (int) $ticketId > 0) { $this->timesheetsService->punchOut((int) $ticketId); } else { $this->timesheetsService->stopActiveTimer(); } return ToolResult::text('Timer stopped successfully.'); } }