ensureAbility($request, 'read', $this->name)) { return $error; } $teamId = $this->resolveTeamId($request); if (is_null($teamId)) { return $this->mcpError($request, 'Invalid token.'); } $uuid = $request->get('uuid'); if (! is_string($uuid) || $uuid === '') { return $this->mcpError($request, 'uuid argument is required.'); } $service = Service::whereRelation('environment.project.team', 'id', $teamId) ->where('uuid', $uuid) ->first(); if (! $service) { return $this->mcpError($request, "Service [{$uuid}] not found.", ['resource_uuid' => $uuid]); } $apps = $service->applications() ->get() ->map(fn ($app) => $this->scrubSensitive([ 'uuid' => $app->uuid, 'name' => $app->name, 'human_name' => $app->human_name ?? null, 'status' => $app->status, 'fqdn' => $app->fqdn, 'image' => $app->image ?? null, ])) ->values() ->all(); return $this->mcpSuccess($request, $this->respond([ 'service_uuid' => $uuid, 'applications' => $apps, ]), ['resource_uuid' => $uuid]); } public function schema(JsonSchema $schema): array { return [ 'uuid' => $schema->string()->description('Service UUID.')->required(), ]; } }