Apply count
apply_countApply a count to stock. This writes stock adjustments for every accepted line and cannot be undone. The first call without confirm_token does not write. It returns confirmation_required, confirm_token, and a summary with the count name, the target location, how many lines will change, net units, how many lines are accepted, not appliable, unresolved, and marked recount, how many items drifted (stock changed since the compare), a phone warning, and blockers. Show that summary to the user and wait for an explicit yes, then call again with the same arguments plus confirm_token. A confirm boolean is ignored. If there are blockers, or drift while allow_drift is false, the call returns the summary with can_apply false and no token. Fix that first (usually compare_count again). allow_drift defaults to false, which refuses to apply when stock changed since the compare. Set it to true only when the user accepts that each variance is added on top of the stock as it is now. The token is bound to this key, this organization, this count, allow_drift, and the state that was shown: the compare time, the exact set of lines that will be written and their variances, how many lines will change, stay the same, or are not appliable, the accepted lines, net units, the drifted count, and the target location. Any new compare, a different accepted line (even with the same variance), a changed variance, or a changed location rejects the token. If there is no location yet, target_location is null and creates_default_location is true, which means apply creates the default location of the sheet. It expires in 5 minutes and works once. Requires the stock plan feature. Two-step confirm_token: the first call without confirm_token only returns confirmation_required, a summary, and confirm_token. That call does not write, delete, cancel, or send. The second call must repeat the same arguments plus that confirm_token; that is the write. A confirm boolean is ignored. The token expires in 5 minutes and works once.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"count_id": "<count_id>"
},
"name": "apply_count"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count_id | Yes | ||
| allow_drift | No | ||
| confirm_token | No |