Skip to main content
Glama

count_leads

Read-only

Return { count } — the TOTAL number of leads matching a filter, without fetching any rows. Accepts the exact same filters as list_leads (search, category, status, campaign_id, no_campaign, owner_id, min_score, stale_days). Use this to size a segment before listing/exporting (e.g. how many stale leads, how many in a campaign).

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_leads"
  }
}

Input Schema

NameRequiredDescriptionDefault
customNoFilter on lead custom fields (list_custom_fields entity 'leads'): { key: value } — value = equals (multiselect: contains), array = any of (multiselect: contains all), null = empty. E.g. { "stufe": "A", "marken": ["KTM"] }.
searchNoFree-text search term
statusNoOnly entries with this status
categoryNoExact category match (case-insensitive)
owner_idNoID of the owner (user)
min_scoreNoOnly count leads with at least this score (0-100)
stale_daysNoOnly leads whose last activity is older than N days
campaign_idNoID of the campaign
no_campaignNoOnly leads not assigned to any campaign

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / campaign_id / description
      Added value: +"ID of the campaign"
    • addedInput schema / properties / min_score / description
      Added value: +"Only count leads with at least this score (0-100)"
    • addedInput schema / properties / owner_id / description
      Added value: +"ID of the owner (user)"
    • addedInput schema / properties / search / description
      Added value: +"Free-text search term"
    • addedInput schema / properties / status / description
      Added value: +"Only entries with this status"
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered. The description adds useful behavior beyond that: it returns only { count } and does not fetch rows, which tells the agent this is a sizing operation rather than a data retrieval operation.

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?

The definition is compact and front-loaded: return shape first, filter compatibility second, intended usage third. Every sentence adds useful routing or behavioral information without repetition.

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 read-only count tool with fully documented parameters and no output schema, the description supplies the missing return shape and explains the intended pre-listing/pre-export use case. No material information needed to invoke it correctly appears to be absent.

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 all nine filters, including the nested custom object, are already documented in the schema. The description names most filters and says they match list_leads, but adds no filter syntax or semantics 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?

The description states a specific verb and resource: return the TOTAL number of leads matching a filter, explicitly without fetching rows. It clearly distinguishes this from list_leads by emphasizing count-only behavior.

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?

It gives a clear use case: size a segment before listing/exporting, with examples for stale leads and campaign leads. It names list_leads as the filter-compatible alternative but does not explicitly state when not to use this tool.

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.