# Quota allocation check

`quota-allocation-check` · version 1.0.0 · Numbers & math · free, no key needed

Check an exact claimed allocation for eligibility and per-bin lower and upper quotas.

**Use when you need to: check allocation quotas · validate lower and upper bin quotas · audit quota constrained assignment.**

## Decide before calling

Read the [versioned contract](/v1/tools/quota-allocation-check/versions/1.0.0) and the supported scope below. Reuse `quota-allocation-check@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `quota-allocation-check@1.0.0` for check allocation quotas. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- check allocation quotas
- validate lower and upper bin quotas
- audit quota constrained assignment
- check bin occupancy bounds
- detect quota violations
- validate claimed quota allocation

## Not supported

- solve a quota assignment
- rank feasible allocations

## Behavior

- Items and bins use exact, case-sensitive string identifiers; duplicate declarations and duplicate eligibility entries are malformed.
- A false claim is reported at the first source item, then source bin, then claim index relevant to the discrepancy; no assignment is repaired or synthesized.
- Null is never an identifier, decimal, array, object, or quota; unknown fields are rejected.
- Reference version: Ahuja-Magnanti-Orlin-Network-Flows-1993-chapter-12.

## Input

- `items` (array of object, required): min items 1; max items 2000
- `bins` (array of object, required): min items 1; max items 500
- `claim` (object, required)

## Output

- `valid` (boolean, required)
- `reason` (string, required): min length 1
- `discrepancy` (object or null, required)
- `reference_version` (constant "Ahuja-Magnanti-Orlin-Network-Flows-1993-chapter-12", required)

## Limits

- max input bytes: 262144
- max items: 2000
- max bins: 500
- max assignments: 4000
- max eligible bins per item: 500

## Example

Request input:

```json
{
  "items": [
    {
      "id": "i1",
      "eligible_bins": [
        "b1"
      ]
    }
  ],
  "bins": [
    {
      "id": "b1",
      "lower_quota": 1,
      "upper_quota": 1
    }
  ],
  "claim": {
    "assignments": [
      {
        "item_id": "i1",
        "bin_id": "b1"
      }
    ]
  }
}
```

Response:

```json
{
  "result": {
    "valid": true,
    "reason": "claim_exact",
    "discrepancy": null,
    "reference_version": "Ahuja-Magnanti-Orlin-Network-Flows-1993-chapter-12"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "quota-allocation-check",
  "version": "1.0.0",
  "input": {
    "items": [
      {
        "id": "i1",
        "eligible_bins": [
          "b1"
        ]
      }
    ],
    "bins": [
      {
        "id": "b1",
        "lower_quota": 1,
        "upper_quota": 1
      }
    ],
    "claim": {
      "assignments": [
        {
          "item_id": "i1",
          "bin_id": "b1"
        }
      ]
    }
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/quota-allocation-check/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"items":[{"id":"i1","eligible_bins":["b1"]}],"bins":[{"id":"b1","lower_quota":1,"upper_quota":1}],"claim":{"assignments":[{"item_id":"i1","bin_id":"b1"}]}}'
```

The machine-readable contract is at [/v1/tools/quota-allocation-check/versions/1.0.0](/v1/tools/quota-allocation-check/versions/1.0.0).

### CLI

```sh
node cli.mjs run quota-allocation-check 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Assignment feasibility check](/tools/assignment-feasibility-check): Check whether a claimed item-to-bin assignment is complete, unique, declared, and eligible.
- [Capacity allocation check](/tools/capacity-allocation-check): Check an exact claimed allocation for eligibility and per-bin decimal capacity compliance.
- [Coloring count check](/tools/coloring-count-check): Check a proper indexed coloring and an exact canonical-decimal claim for its number of distinct colors.
- [Interval duration check](/tools/interval-duration-check): Check a claimed duration between two RFC 3339 instants as exact elapsed time or as a calendar duration.
- [Lp dual feasibility check](/tools/lp-dual-feasibility-check): Check that LP dual multipliers satisfy y >= 0 and yA >= c exactly; return the proven upper bound y.b.
- [Multiset difference check](/tools/multiset-difference-check): Check claimed left-only and right-only scalar bag differences in deterministic source order.
