integer('userId')->description('User ID to get status labels for.')->required(); } /** * Handle the tool request. */ public function handle(array $arguments): ToolResult { $userId = (int) ($arguments['userId'] ?? 0); if ($userId === 0) { $userId = session('userdata.id'); } $status = $this->ticketsService->getAllStatusLabelsByUserId($userId); $statusAIString = '## Status Labels'; foreach ($status as $projectKey => $projectStatus) { foreach ($projectStatus as $key => $value) { $result = [ 'id' => $key, 'projectId' => $projectKey, 'name' => $value['name'], 'statusType' => $value['statusType'], 'isKanbanColumn' => $value['kanbanCol'] === '1' ? 'yes' : 'no', ]; $statusAIString .= Str::toMarkdown($result)."\n"; } } return ToolResult::text($statusAIString); } }