Skip to main content
Glama

Count threads

threads_count
Read-onlyIdempotent

Count threads

How many threads the filters match, as the search index counts them; a thread changed in the last moments may be counted as it was. Use it to size a folder before paging through it.

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": "threads_count"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagNoThreads whose contact has one of these tags. Repeat the key to match any of several.
viewNoA view's `id` from List views: lists the threads that view lists, in place of `folder`. Every other filter narrows it, except `includeArchived`. A cursor issued for a saved view is `invalidCursor` once the view changes.
folderNoDefaults to `inbox`, threads that are neither archived nor requests, leaving out conversations a platform keeps outside the inbox, such as chats with bots. `noReply` is `inbox` with `awaitingReply=true`. `requests` holds unarchived threads where `isRequest` is true. `archived` includes requests. `all` spans every thread, including chats kept out of the inbox. Every other filter narrows the folder, except `includeArchived`. Each folder is also a view: `inbox`, `awaitingReply` for `noReply`, `requests`, `archived` and `all`.
statusNoThreads whose contact has one of these statuses. Repeat the key to match any of several.
unreadNo`true` keeps threads unread for the agent's member, as `unread` shows them. A thread marked read moments ago may still be listed, with its current `unread`. Agents only: an API token has no member and gets `memberRequired`.
platformNoRepeat the key to match any of several.
contactIdNoThreads with these contacts. With `accountLinkId`, finds the thread between an account and a contact. Repeat the key to match any of several.
assigneeIdNoThreads whose `assigneeId`, the thread's own assignee or else its contact's, is one of these members. Repeat the key to match any of several.
campaignIdNoThreads these campaigns sent a message in. Campaign sends archive the thread, so pair it with `folder=archived`, `folder=all` or `includeArchived=true`. Repeat the key to match any of several.
unassignedNo`true` keeps threads with no assignee, including through their contact. Not combinable with `assigneeId`.
accountLinkIdNoThreads of these account links. Repeat the key to match any of several.
awaitingReplyNo`true` keeps threads whose latest activity is inbound, the inbox's No reply.
includeArchivedNo`true` adds the view's or folder's archived threads back, the inbox's With archived. A view that tests archived inside an any-of or a not-group keeps that test. No effect when the scope already includes archived threads.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / $defs / Platform / description
      Previous value: -"The platform. Every team can use twitter, linkedin, whatsapp; a team may have others enabled."New value: +"The platform. Every team can use twitter, linkedin, whatsapp, telegram; a team may have others enabled."
    • changedInput schema / $defs / Platform / examples
      Previous value: -[
      -  "twitter",
      -  "linkedin",
      -  "whatsapp"
      -]New value: +[
      +  "twitter",
      +  "linkedin",
      +  "whatsapp",
      +  "telegram"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / folder / description
      Previous value: -"Defaults to `inbox`, threads that are neither archived nor requests. `noReply` is `inbox` with `awaitingReply=true`. `requests` holds unarchived threads where `isRequest` is true. `archived` includes requests. `all` spans every folder. Every other filter narrows the folder, except `includeArchived`. Each folder is also a view: `inbox`, `awaitingReply` for `noReply`, `requests`, `archived` and `all`."New value: +"Defaults to `inbox`, threads that are neither archived nor requests, leaving out conversations a platform keeps outside the inbox, such as chats with bots. `noReply` is `inbox` with `awaitingReply=true`. `requests` holds unarchived threads where `isRequest` is true. `archived` includes requests. `all` spans every thread, including chats kept out of the inbox. Every other filter narrows the folder, except `includeArchived`. Each folder is also a view: `inbox`, `awaitingReply` for `noReply`, `requests`, `archived` and `all`."
  3. Changed6 schema fields changed
    • addedInput schema / properties / awaitingReply
      Added value: +{
      +  "description": "`true` keeps threads whose latest activity is inbound, the inbox's No reply.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / campaignId / description
      Previous value: -"Threads these campaigns sent a message in. Campaign sends archive the thread, so pair it with `folder=archived` or `all`. Repeat the key to match any of several."New value: +"Threads these campaigns sent a message in. Campaign sends archive the thread, so pair it with `folder=archived`, `folder=all` or `includeArchived=true`. Repeat the key to match any of several."
    • changedInput schema / properties / folder / description
      Previous value: -"Defaults to `inbox`, threads that are neither archived nor requests. `noReply` is the `inbox` threads whose latest activity is inbound. `requests` holds unarchived threads where `isRequest` is true. `archived` includes requests. `all` spans every folder. Every other filter narrows the folder. Each folder is also a view: `inbox`, `awaitingReply` for `noReply`, `requests`, `archived` and `all`."New value: +"Defaults to `inbox`, threads that are neither archived nor requests. `noReply` is `inbox` with `awaitingReply=true`. `requests` holds unarchived threads where `isRequest` is true. `archived` includes requests. `all` spans every folder. Every other filter narrows the folder, except `includeArchived`. Each folder is also a view: `inbox`, `awaitingReply` for `noReply`, `requests`, `archived` and `all`."
    • addedInput schema / properties / includeArchived
      Added value: +{
      +  "description": "`true` adds the view's or folder's archived threads back, the inbox's With archived. A view that tests archived inside an any-of or a not-group keeps that test. No effect when the scope already includes archived threads.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / unread
      Added value: +{
      +  "description": "`true` keeps threads unread for the agent's member, as `unread` shows them. A thread marked read moments ago may still be listed, with its current `unread`. Agents only: an API token has no member and gets `memberRequired`.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / view / description
      Previous value: -"A view's `id` from List views: lists the threads that view lists, in place of `folder`. Every other filter narrows it. A cursor issued for a saved view is `invalidCursor` once the view changes."New value: +"A view's `id` from List views: lists the threads that view lists, in place of `folder`. Every other filter narrows it, except `includeArchived`. A cursor issued for a saved view is `invalidCursor` once the view changes."
  4. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and open-world, so the safety profile needs no restating. The description adds a genuinely useful caveat not in annotations or schema: counts reflect the search index and a thread changed moments ago 'may be counted as it was', i.e. eventual consistency. It stops short of saying anything about cost, rate limits, or the exact return shape.

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

Conciseness5/5

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

Two sentences plus a title, front-loaded with the definition and ending with the actionable guidance. No filler, no restatement of the tool name or annotations.

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

Completeness4/5

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

Covers purpose, cost-independent sizing use, and the index-lag caveat for a 13-parameter read filter tool with no output schema. The only gap is that it never states the return value is a single number, which the agent must infer from 'count'.

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% across all 13 optional filters, and the descriptions there are unusually rich (folder pruning, view cursor invalidation, unassigned/assigneeId exclusion). The tool description adds nothing beyond the schema about parameters, so the baseline 3 applies.

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

Purpose4/5

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

States a specific verb and resource ('Count threads … How many threads the filters match') and implicitly distinguishes itself from the paging tool by framing itself as a sizing step. It never names the sibling (e.g. threads_list), so the differentiation is inferred rather than explicit.

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

Usage Guidelines4/5

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

'Use it to size a folder before paging through it' gives a concrete when-to-use condition tied to the sibling list workflow. It does not state when not to use it (e.g. when the exact page contents are needed) or name alternatives.

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