> For the complete documentation index, see [llms.txt](https://kb.theloops.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.theloops.io/agentstudio/skills-library/service-management-and-contracts/detect-request-contract-coverage-gap.md). Agents can also search and read this documentation through its [MCP server](https://kb.theloops.io/~gitbook/mcp).

# Detect Request Contract Coverage Gap

Checks one service request and reports per-scope request-contract coverage verdicts (COVERED, gaps, or WARRANTY\_ONLY). Reads the request, scopes, contract header/lines and active contract candidates.

| Business area                    | Action type |
| -------------------------------- | ----------- |
| Service Management and Contracts | Read-only   |

## Overview

A service request (SrvRequest) has one or more scopes (SrvRequestScope). Each scope may reference a request contract (ContractId, ContractRevision) and a request service line (LineNo).

The IFS Cloud integration reads service requests, scopes and request contracts (read-only) to detect contract coverage gaps.

## How it works

{% stepper %}
{% step %}
Get Service Request Contract Context with `req_id`. Not found → say so and stop. If isCancelled = true (`Objstate` Cancelled), report `NOT_APPLICABLE`.
{% endstep %}

{% step %}
List Request Scopes Coverage with `req_id`. Ignore scopes where isCancelledScope = true (list them as excluded).
{% endstep %}

{% step %}
For each scope with `ContractId`, read the contract header and request contract line, then validate coverage (contract state, date range, customer and site alignment, fault-report flag).
{% endstep %}

{% step %}
For each scope without `ContractId`: if UnderWarranty = TRUE → `WARRANTY_ONLY`. Else GAP\_NO\_CONTRACT and call Find Active Request Contracts For Customer once per customer to list up to 5 candidates.
{% endstep %}

{% step %}
Overall: `COVERED` only if all non-cancelled scopes are `COVERED` or `WARRANTY_ONLY`.
{% endstep %}
{% endstepper %}

## Key capabilities

* Read a service request header with customer, registration date and connected contract IDs.
* Read every scope's contract reference, customer, sales site, warranty flags and IgnoreContractDates.
* Read the request contract header (state, validity dates, customer, sites, additional customers).
* Read the referenced request service line validity dates and fault-report agreement.
* Search active request contracts for the same customer as remediation candidates.
* Apply the IFS service-line validation rules as a read-only simulation.
* Return a per-scope verdict, evidence and a single next permissible action.

## Requirements

The following IFS Cloud components and projections must be available, with permission sets that grant access to each projection.

| Component | Projection              |
| --------- | ----------------------- |
| SRVCON    | RequestHandling         |
| PCMSCI    | ServiceContractHandling |

## Version compatibility

| Projection              | Supported IFS Cloud releases |
| ----------------------- | ---------------------------- |
| RequestHandling         | 24R2, 25R1, 25R2, 26R1, 26R2 |
| ServiceContractHandling | 24R2, 25R1, 25R2, 26R1, 26R2 |

## Known limitations

* Read-only: does not create, update, or delete IFS Cloud data.
* Requires projection-level security. Permission errors halt the run.
