Skip to main content
Glama

Count devices

count_devices
Read-onlyIdempotent

Count the authenticated company's devices, optionally narrowed by device status, assigned policy (or several, with "policies"), "lastSyncBefore" (each device's last sync, the portal's "Last sync", before an instant: use it for devices not synced, not seen or offline since a date), "lastSeenBefore" (asset record updated before an instant; not proof of being offline) and/or "missing" (devices without an IMEI or a serial number, e.g. "how many devices have no IMEI"). Use this instead of search_devices when only a total is needed, e.g. "how many active devices do we have" or "how many devices have not synced in a week". With "groupBy" it breaks the count down by "policy", "model" and/or "status" in one call, exact for the whole fleet: use it for which models are in a policy, how many of each model, or each model per policy, never search_devices, whose results are capped.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "count_devices"
  }
}

Input Schema

NameRequiredDescriptionDefault
policyNoFilter by the policy's path name (its unique short identifier, as returned by list_policies as "pathName" - not its human-readable display name).
statusNoFilter by device status. ACTIVE = enrolled and functioning normally; INACTIVE = enrolled but disabled; SYNCHRONIZING = enrollment in progress; DELETED = removed from the fleet; REPROVISIONED = wiped and re-enrolled; EXTERNAL = tracked as an asset without MDM enrollment.
companyNoOptional: a `company` value from list_companies to run this in. Omit it for the connection's own company.
groupByNoBreak the count down: one group per combination of these values, largest first, each with its count ("model" is the device's model code, with its commercial "marketingName" when known; null when the device reports none). ["model"] answers how many devices of each model; ["policy", "model"] each model per policy.
missingNoOnly devices that have none of these identifiers: "imei" (no IMEI: a Wi-Fi-only device, or one that never reported it) and/or "serialNumber" (no serial number). Use it for questions such as how many devices have no IMEI, or which ones.
policiesNoCount the devices of any of these policies (path names, as for "policy"), all in one call. Use it for a group of policies, e.g. every policy whose name contains a word.
lastSeenBeforeNoOnly include assets whose record was updated before this ISO-8601 instant (e.g. "2026-01-01T00:00:00Z"). Metadata changes can update the record; this does not prove the device is offline. Must not be in the future. Minute-granularity: a device updated up to 59 seconds after this instant may still be included.
lastSyncBeforeNoOnly include devices whose last sync (the portal's "Last sync": their last contact with Nomid) is before this ISO-8601 instant (e.g. "2026-01-01T00:00:00Z"). Use it for devices not synced, not seen or offline since a date. A device that never synced, or an asset without MDM, has no last sync and is never included. Must not be in the future. Minute-granularity: a device that synced up to 59 seconds after this instant may still be included.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds real behavioral context beyond them: lastSyncBefore excludes never-synced devices and assets without MDM, lastSeenBefore is explicitly not proof of being offline, and both date filters have minute-granularity slack. It also discloses groupBy output ordering (largest first) and the null-model case. It stops short of describing total-result shape when no groupBy is used, but the coverage is well above the annotation baseline.

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?

Front-loaded with the core action and the search_devices contrast before any filter detail, and every clause carries information. It is heavy on nested parentheticals and quoted parameter names, making it a dense read for a single paragraph, but nothing is filler.

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 eight-parameter, zero-required counting tool with no output schema, the definition covers result semantics (groups, largest first, per-combination counts), exclusions (never-synced devices dropped), and cross-filter relationships. An agent has enough to construct a correct call and interpret the count without further documentation.

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 coverage is 100%, so baseline is 3; the description earns above that by disambiguating near-identical parameters that the schema documents only in isolation — the singular policy vs. plural policies distinction, and the portal-mapped meaning of lastSyncBefore ("Last sync") versus the metadata-only lastSeenBefore, plus an example question for missing. Some of this restates the schema's own text, which keeps it from a 5.

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+resource ("Count the authenticated company's devices") and immediately delimits scope with the optional filters. It explicitly names the sibling it replaces ("Use this instead of search_devices when only a total is needed"), so an agent can route between the two without opening schemas.

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 concrete when-to-use triggers with example phrasings ("how many active devices do we have", "how many devices have not synced in a week") and an explicit alternative: use search_devices only for per-device results, and "never search_devices" when groupBy is needed because those results are capped. Both the positive and negative conditions are stated.

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