Skip to main content
Glama

Apply count

apply_count
Destructive

Apply 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

NameRequiredDescriptionDefault
count_idYes
allow_driftNo
confirm_tokenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations only say destructive/non-idempotent/non-readonly; the description goes far beyond them with the irreversible nature of the write, the two-step token handshake, the 5-minute single-use expiry, the exact dimensions the token is bound to, the default-location creation behaviour, and the stock-plan feature requirement. It also discloses the failure mode (can_apply false, no token) and that a confirm boolean is ignored.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening is well front-loaded, but the two-step confirm_token mechanics are restated almost verbatim at the end ('A confirm boolean is ignored', 'expires in 5 minutes and works once' each appear twice), making the text substantially longer than the information requires. The token-binding enumeration is also dense enough to be hard to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, token-gated write with no output schema and no schema descriptions, the description supplies everything an agent needs: the confirm flow, expiry, failure conditions, drift policy, default-location behaviour and feature prerequisite. Nothing material about invoking it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry the parameters, and it does for two of three: allow_drift is given a default plus a precise semantic ('each variance is added on top of the stock as it is now'), and confirm_token's binding, expiry and single-use rules are exhaustively defined. count_id is only implied ('this count', 'this key, this organization, this count') with no format or sourcing guidance, which is the one gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource ('Apply a count to stock') and immediately states the effect ('writes stock adjustments for every accepted line and cannot be undone'). It also names the relevant sibling, compare_count, so an agent can distinguish this terminal write step from the comparison step.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use and when-not-to-use guidance: the first call without confirm_token is a dry run, the second with the token is the write, and blockers or drift with allow_drift false mean the agent must go back and fix things first ('usually compare_count again'). It also spells out precisely when to set allow_drift to true, which is the main judgement call for an agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources