Skip to main content
Glama

Wait For Inventory Job

cnc_wait_for_inventory_job
Read-onlyIdempotent

Poll an inventory job until it reaches a terminal state or times out, instead of rechecking it in a loop after a write returns JOB_RUNNING. Reports success, warnings, or failure.

Instructions

Poll an inventory job until it reaches a terminal state or the timeout elapses.

Read-only. Use it right after a write that came back JOB_RUNNING instead of calling cnc_get_inventory_job in a loop. Terminal states are the verified ones: JOB_COMPLETED and JOB_COMPLETED_WITH_WARNING (both successes; the latter carries an advisory, e.g. a no-op or partially applied write), and JOB_FAILED / JOB_CANCELLED / JOB_ABORTED (failures). Any other state (JOB_RUNNING or an in-progress state not seen before) keeps the tool polling until the timeout.

Returns: str: "Inventory job completed after s." followed by the job JSON (with "impacted_objects" parsed from "impacted") on success; for JOB_COMPLETED_WITH_WARNING the line also carries "Warning: " and the JSON gains a "warning" key. A timeout is NOT an error: "Inventory job not finished after s; current state: JOB_RUNNING. ..." followed by the job JSON — call again to keep waiting. "Error: Inventory job failed (job , state JOB_FAILED): " when the job ended unsuccessfully; "Error: No inventory job with id ..." when the id matches nothing; other API failures: "Error: ...".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesInventory job id to wait for (e.g. '0f6c1a2e-...').
timeout_secondsNoGive up after this many seconds (e.g. 120).
interval_secondsNoSeconds between polls (e.g. 5).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already establish read-only, idempotent, non-destructive behavior, but the description adds substantial behavioral detail: terminal states, warning semantics, timeout-as-non-error handling, and error return shapes. Nothing contradicts the annotations.

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

Conciseness4/5

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

The first sentence is front-loaded and the usage guidance is clear. The returns block is lengthy and partly overlaps the output schema, but it earns its place by explaining timeout and warning behavior.

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 an asynchronous polling tool with annotations, a full input schema, and an output schema, the description is complete enough to call correctly. It covers usage context, terminal states, timeout behavior, and error semantics.

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

Parameters3/5

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

Schema description coverage is 100%, so job_id, timeout_seconds, and interval_seconds are already documented in the schema. The description alludes to timeout behavior but does not add syntax, defaults, or constraints beyond the schema.

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?

States a specific verb and resource: poll an inventory job until terminal state or timeout. It distinguishes itself from the sibling cnc_get_inventory_job by explicitly saying to use this instead of calling that tool in a loop.

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 guidance: right after a write returns JOB_RUNNING, rather than polling cnc_get_inventory_job manually. It also clarifies that timeout is not an error and that the caller should call again to keep waiting.

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