Skip to main content
Glama

search_leads

Search and filter leads in the database to find prospects by name, email, company, or status. Returns paginated results with contact details and channel history for outreach planning.

Instructions

Search and filter leads in the database. Returns paginated results with name, email, company, status, and channel history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchNoSearch by name, email, or company
statusNoFilter by lead status
pageNoPage number (default 1)
limitNoResults per page (default 20, max 100)

Implementation Reference

  • The handler for 'search_leads' tool, which takes arguments and calls the API client method.
    handler: async (args: Record<string, unknown>) => {
      const leads = await client.searchLeads({
        search: args.search as string | undefined,
        status: args.status as string | undefined,
        page: args.page as number | undefined,
        limit: args.limit as number | undefined,
      });
      return JSON.stringify(leads, null, 2);
    },
  • Input schema definition for 'search_leads' tool.
    inputSchema: {
      type: 'object' as const,
      properties: {
        search: { type: 'string', description: 'Search by name, email, or company' },
        status: {
          type: 'string',
          enum: ['found', 'contacted', 'engaged', 'replied', 'converted', 'excluded'],
          description: 'Filter by lead status',
        },
        page: { type: 'number', description: 'Page number (default 1)' },
        limit: { type: 'number', description: 'Results per page (default 20, max 100)' },
      },
    },
  • The API client method that performs the actual network request to search leads.
    async searchLeads(opts: {
      search?: string;
      page?: number;
      limit?: number;
      status?: string;
      tags?: string[];
    }) {
      const params = new URLSearchParams();
      if (opts.search) params.set('search', opts.search);
      if (opts.page) params.set('page', String(opts.page));
      if (opts.limit) params.set('limit', String(opts.limit));
      if (opts.status) params.set('status', opts.status);
      if (opts.tags?.length) params.set('tags', opts.tags.join(','));
      return this.request('GET', `/api/leads?${params.toString()}`);
    }
Behavior3/5

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

Without annotations, the description carries the full burden. It successfully discloses pagination behavior and specific return fields (name, email, company, status, channel history), but omits safety characteristics (read-only nature), rate limits, or search matching behavior (exact vs. partial).

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 with zero waste: first establishes the operation, second describes the return payload. Every word earns its place and critical information is front-loaded.

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 4-parameter search tool with simple types and no output schema, the description adequately compensates by documenting the return structure and pagination behavior. Lacking annotations, it could still benefit from safety disclaimers, but covers the essential contract.

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%, providing full parameter documentation. The description does not add parameter-specific semantics or usage hints beyond the schema, warranting the baseline score of 3.

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 core action ('Search and filter') and resource ('leads'), establishing specific scope. While it doesn't explicitly differentiate from siblings, the tool name and description together make the distinct purpose clear relative to the 'create', 'get', and 'list' siblings.

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

Usage Guidelines3/5

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

Provides implicit guidance through the verb 'Search and filter' indicating this is for querying existing records, but lacks explicit when-to-use guidance or mention of alternatives. Given the distinct naming from siblings (create_agent, get_activity, etc.), the agent can infer appropriate usage.

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/diegotorreslopez81/swarmix-mcp'

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