Skip to main content
Glama

Search leads

search_leads
Read-only

Search the caller's CRM leads with the workspace's own fields — the structured counterpart of list_leads with sorting. Filters: 'status', 'source', 'created_after' / 'created_before'. More filters (see each property): 'custom' / 'custom_range' / 'custom_exists' (filterable fields of crm_list_fields, at most 8 conditions), 'q', 'city', 'tags', 'pipeline' + 'pipeline_stage' / 'stage_category', 'has_channel' / 'channel_status'. 'fields' shapes the rows (a pipeline lead always carries pipeline and stage). 'sort': created_at / -created_at / company / -company / updated_at / -updated_at, or custom. / -custom. for an indexed field. 'limit' 1..100 (default 20) + 'offset'. Returns {leads, total, has_more}. Read-only; only the caller's own workspace.

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

Input Schema

NameRequiredDescriptionDefault
qNoFree text: company / name / e-mail substring, or an exact phone (any format), domain or ЄДРПОУ.
cityNoThe lead's city (exact, case-insensitive; a list = any of; 'Ки*' = prefix).
modeNo'summary' = counts by status/source + the top 5 rows (a few KB).
sortNo
tagsNo
limitNo
cursorNonext_cursor from the previous page (instead of offset).
customNoEquality on the workspace's own fields (crm_list_fields), e.g. {"niche": "printing", "site_status": ["none", "broken"]}: a list = any of, 'x*' = prefix; an unknown or non-filterable key → unknown_field.
fieldsNo'custom' / 'tags' ADD that data to each row; any other names keep ONLY those keys (plus id) — e.g. ['company','status'] for a compact list.
offsetNo
sourceNo
statusNo
pipelineNoOnly leads of this pipeline (crm_pipeline_get); 'inbound' = «Вхідні заявки».
has_channelNoLeads that have a contact point of each of these kinds.
custom_rangeNoRanges on number / money_eur / date fields: {"setup_amount": {"gte": 300, "lte": 1000}}.
created_afterNo
custom_existsNoField keys that must have a value.
channel_statusNoContact point status per kind, e.g. {"telegram": "available"} (a list = any of): unverified (nobody checked), available, not_found, unknown, invalid, opted_out.
created_beforeNo
pipeline_stageNoStage slug(s) of 'pipeline' (any of).
stage_categoryNoStage category(ies): sourcing, enrichment, channel_check, proposal, approval, outreach, follow_up, reply, terminal.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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 and openWorldHint=false, and the description adds workspace-scoping ('only the caller's own workspace'), hard caps ('at most 8 conditions', 'limit 1..100 (default 20)'), and the return envelope {leads, total, has_more} — real behavioral context beyond the annotations. It does not mention pagination-consistency behavior between cursor and offset, nor row-size expectations beyond the schema's own 'mode' note.

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 purpose and sibling differentiation, then a tight quoted-parameter inventory; almost every clause carries new information. The middle filter list is dense and reads as a run-on, but the density is functional rather than padded.

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?

For a 21-parameter tool with nested objects and no output schema, supplying the return shape, the default limit, and the pipeline/stage coupling ('a pipeline lead always carries pipeline and stage') covers most of what an agent needs before calling. The missing pieces are the 'mode' summary path and cursor semantics, which are exactly the parts where an agent might otherwise page incorrectly.

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 62%, and the description compensates well: it groups the filter families, states the 8-condition custom cap, enumerates the allowed sort values including the custom.<key> form for indexed fields, and explains that 'fields' both adds (custom/tags) and restricts (any other key) rather than just projecting. Gaps remain: 'mode' and 'cursor' are never mentioned in the description, so the summary mode and cursor-based pagination are only discoverable from 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+resource ('Search the caller's CRM leads') and immediately scopes it ('with the workspace's own fields'), then distinguishes it from the sibling list_leads by calling itself 'the structured counterpart of list_leads with sorting'. An agent can tell the two apart without opening either schema.

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 clear routing context by positioning itself as the filtered/sorted alternative to list_leads, which establishes when to reach for this tool. It stops short of explicit exclusions — nothing is said about leads_summary, stale_leads, or crm_list_fields, which also touch the same data.

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