Skip to main content
Glama

leads_context_merge

Shallow-merges the request body into lead.context. Use this to add or update individual context fields without touching the rest. After the merge, the lead is re-evaluated against every segment's filters so any new matches take effect.

To replace the entire context dict, use leads_update with a full context field instead.

Method: PATCH /api/v1/workspaces/{workspace_sqid}/leads/{sqid}/context/

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sqid": "<sqid>"
    },
    "name": "leads_context_merge"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqidYes
notesNo
statusNoLead lifecycle stage: NEW → IN_PROGRESS → REPLIED / INTERESTED / NOT_INTERESTED (a person replied; REPLIED = needs a human to read it) or COMPLETED (campaign finished without a reply); also UNSUBSCRIBED, FAILED, ARCHIVED. Set automatically from replies; override to record your own judgement of a reply (e.g. REPLIED → INTERESTED). UNSUBSCRIBED is permanent: an opt-out can't be changed back. * `NEW` - New * `IN_PROGRESS` - In Progress * `REPLIED` - Replied * `INTERESTED` - Interested * `NOT_INTERESTED` - Not Interested * `COMPLETED` - Completed * `FAILED` - Failed * `UNSUBSCRIBED` - Unsubscribed * `ARCHIVED` - Archived
contactNoPrimary contact value — an email address when contact_type='email', a phone number or LinkedIn URL otherwise.
contextNoFree-form JSON object for workspace-defined custom fields (see context_fields). Keys referenced as ${field_key} in sequence step templates. PATCH this via the 'context' action to merge rather than replace.
lead_nameNoDisplay name (usually 'First Last' or company name for company-only leads).
contact_typeNoChannel: 'email', 'phone', or 'linkedin'. Email is the only channel that can drive campaigns. * `EMAIL` - Email * `PHONE` - Phone * `LINKEDIN` - LinkedIn * `OTHER` - Other
last_sale_atNoDate of the last sale to this recipient.
prior_customerNoThe recipient bought from you before (existing-customer rules).
role_relevanceNoOne sentence on why the offer fits this person's job. Required by some countries' rules for named addresses.
declared_countryNoCountry you state for this recipient: ISO 2-letter code or English name. It can make the result stricter, never looser, when other sources disagree. Changing it re-resolves recipient_country.
discovery_person_guidNoGUID of the discovery Person this lead was sourced from (if any). Must reference a GUID the workspace has access to. Set to null to unlink.
discovery_company_guidNoGUID of the discovery Company this lead was sourced from (if any). Used by enrichments to look up company metadata. Must reference a GUID the workspace has access to.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

No annotations exist, so the description carries the burden, and it discloses the key non-obvious behavior: merge is shallow (untouched keys survive), and the lead is re-evaluated against every segment's filters afterward so new matches take effect. It omits permissions/auth requirements and what the response contains, which keeps it from a 5.

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 the core action and merge semantics, followed by the alternative and the side effect; every sentence carries information. The trailing 'Method: PATCH ...' line is boilerplate that repeats routing detail and is the only semi-redundant element.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The merge mechanics, the segment re-evaluation side effect, and the replacement alternative are all covered, which is the core of the tool. However, with a 13-parameter schema and no output schema, the description never explains how the non-context fields in the request body relate to this context-only endpoint, a real ambiguity for an agent composing a call.

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 85%, so the schema already documents the parameters and the baseline is 3. The description adds the merge-vs-replace semantic but does not address the other 12 schema fields (notes, status, contact, etc.), leaving unclear whether those are honored or ignored by this endpoint.

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 precise verb and target ('Shallow-merges the request body into `lead.context`') and immediately contrasts with the sibling that replaces the dict ('use `leads_update` with a full `context` field'). An agent can select between the two 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 Guidelines5/5

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

Explicit when-to-use ('add or update individual context fields without touching the rest') and an explicit when-not plus named alternative for full replacement. Nothing is left to inference about which tool to pick for merge vs. replace.

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.