Skip to main content
Glama

search_leads

Search and filter CRM leads using specific criteria to find relevant records. Apply filters based on field types and operators, with support for pagination and sorting.

Instructions

Search/filter leads. Only fields marked [FILTERABLE] in get_lead_field_instructions can be used. Call get_lead_field_instructions first to get filterable fields and their types.

filters: List of filter objects. Each must have:

  • field (str): Field internal/API name (e.g. firstName, country, source, createdAt).

  • operator (str): One of the allowed operators for that field type (e.g. equal, contains, greater).

  • value: Value to compare. For PICK_LIST/MULTI_PICKLIST use Option ID (number), except requirementCurrency, companyBusinessType, country, timezone, companyIndustry — use internal name (string). For date/datetime (incl. custom e.g. cfDateField): value null for today/is_null/is_not_null; single ISO string for greater/greater_or_equal/less/less_or_equal e.g. "2026-02-02T18:30:00.000Z"; for between use [startISO, endISO].

  • timeZone (str, optional): For date/datetime filters only; default from server or env.

  • type (str, optional): Field type from cheat sheet. If omitted, inferred from schema. For user look-up fields (createdBy, updatedBy, convertedBy, ownerId, importedBy): value must be user ID (number). Call lookup_users first. For the products field: value must be product ID (number). Call lookup_products first; if multiple matches, ask which product, then use that ID here. For pipeline / pipelineStage (e.g. open leads, closed leads): call lookup_pipelines first, ask the user to confirm which pipeline, then call get_pipeline_stages for that pipeline only; if stage is ambiguous ask which stage, then use pipeline + pipelineStage filters here. page: 0-based page (default 0). size: Page size, max 100 (default 20). sort: Sort e.g. "createdAt,desc" (default).

Operators by type (examples): TEXT_FIELD: equal, contains, is_empty. NUMBER: equal, greater, between, is_null. PICK_LIST: equal, in, is_null. DATETIME_PICKER: today, yesterday, between, is_not_null, greater, less, current_week, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filtersYes
pageNo
sizeNo
sortNocreatedAt,desc

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure and does so effectively. It describes important constraints (max page size of 100, default values, field-specific value formats), lookup requirements, and data validation rules. The only minor gap is not explicitly mentioning pagination behavior or rate limits.

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

Conciseness3/5

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

The description is information-dense but somewhat lengthy and could be better structured. While every sentence provides value, the information about operators by type at the end might be better placed earlier or in a more scannable format. It's comprehensive but not optimally organized for quick parsing.

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?

Given the tool's complexity (4 parameters, 0% schema coverage, no annotations, but with output schema), the description is remarkably complete. It covers prerequisites, parameter usage, field-specific rules, lookups, defaults, constraints, and operator guidance. With an output schema present, it appropriately doesn't explain return values, focusing instead on usage context.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing comprehensive parameter semantics. It explains the complex 'filters' object structure in detail, documents all four parameters (filters, page, size, sort) with their purposes, constraints, defaults, and special handling rules for different field types. This goes well beyond what the bare schema provides.

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?

The description clearly states the tool's purpose as 'Search/filter leads' with a specific verb and resource. It distinguishes from siblings like 'search_idle_leads' by not specifying a particular lead type, but doesn't explicitly contrast with other search tools. The purpose is clear but sibling differentiation could be more explicit.

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?

The description provides excellent usage guidance with explicit prerequisites (call get_lead_field_instructions first), field restrictions (only [FILTERABLE] fields), and references to sibling tools for lookups (lookup_users, lookup_products, lookup_pipelines, get_pipeline_stages). It clearly indicates when to use alternative tools for preparatory steps.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/akshaykylas94/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server