Skip to main content
Glama

find_lead_by_channel

Read-only

Match a messaging conversation back to a lead/contact. Provide external_chat_id (Beeper chatID, primary key) and/or handle (+optional channel). A phone number as handle is also matched like find_by_phone (incl. contact mobiles) - only a UNIQUE lead or contact is returned. Returns { lead_id, contact_id, do_not_track } or null. Run BEFORE creating records to avoid duplicates.

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

Input Schema

NameRequiredDescriptionDefault
handleNoHandle of the person on the channel, e.g. phone number, mail address or profile URL
channelNoMessaging channel the handle belongs to (narrows a handle match)
external_chat_idNoID of the external chat

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / channel / description
      Added value: +"Messaging channel the handle belongs to (narrows a handle match)"
    • addedInput schema / properties / external_chat_id / description
      Added value: +"ID of the external chat"
    • addedInput schema / properties / handle / description
      Added value: +"Handle of the person on the channel, e.g. phone number, mail address or profile URL"
  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 establish readOnlyHint=true and openWorldHint=false, so the description is not carrying the safety burden. It still adds meaningful behavior beyond them: only a UNIQUE lead or contact is returned, phone handles also match contact mobiles, and the exact return shape { lead_id, contact_id, do_not_track } or null is disclosed.

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?

The content is front-loaded with purpose, then parameters, then return value and the dedup rule, so the ordering is sound. The middle sentence is somewhat dash-heavy and run-on ("- only a UNIQUE lead or contact is returned"), but virtually every clause carries information.

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 3-parameter read tool with no output schema, the description covers parameters, the return contract, the null case, and the intended workflow position. The only gap is undefined behavior when multiple candidates match, which matters for the uniqueness claim but is a minor omission.

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 100%, so a baseline of 3 applies, but the description earns more by identifying external_chat_id as the Beeper chatID primary key and explaining that channel narrows a handle match. It also clarifies that a phone number used as handle triggers contact-mobile matching, which the schema does not convey.

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 opens with a specific verb and resource ("Match a messaging conversation back to a lead/contact") and explicitly distinguishes itself from the sibling find_by_phone by describing how handle matching relates to it. An agent can tell what this tool does and how it differs from adjacent lookups without opening any 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 tells the agent to "Run BEFORE creating records to avoid duplicates" and to supply external_chat_id and/or handle, which is clear sequencing guidance. It does not state a when-not condition (e.g. what to do when multiple leads match) or explicitly name link_channel as the follow-up, so it falls short of full alternative routing.

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.