Skip to main content
Glama

leads_run_automation

Dispatches an async task to run one or all automations on this lead. Body: {automation_sqid: '...'} to run a specific automation, or omit to run all automations from all segments the lead belongs to. Returns {task_sqid} — poll jobs_get for progress.

Method: POST /api/v1/workspaces/{workspace_sqid}/leads/{sqid}/run-automation/

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>",
      "lead_name": "<lead_name>"
    },
    "name": "leads_run_automation"
  }
}

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_nameYesDisplay 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

A3.6/5.0
Behavior4/5

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

With no annotations supplied, the description carries the disclosure burden and does a reasonable job: it explicitly says the call is async, returns `{task_sqid}`, and names `jobs_get` as the polling target, plus the underlying endpoint. It stops short of stating side effects (that automations may actually message the lead) or whether re-dispatch is safe/idempotent, which is the main residual gap for a fire-and-forget action.

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?

Three short sentences, front-loaded with the action and followed by the two body modes and the return/polling contract. The trailing 'Method: POST /api/v1/...' line is lower value than the rest but still useful for debugging, so little is wasted.

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?

For an async dispatch tool with no output schema, the description covers the essentials: input modes, return value, and how to track progress. It is incomplete in that it never reconciles with the large lead-shaped input schema it is paired with, so an agent cannot tell from the description which of those 13 fields actually matter here.

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 baseline is 3. The description adds genuinely new meaning by documenting an `automation_sqid` body field and the semantics of omitting it — but that field does not appear in the supplied input schema at all, so the description and schema do not line up, and nothing is said about the 13 documented lead fields.

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?

States a specific verb and resource: 'Dispatches an async task to run one or all automations on this lead', and distinguishes the two modes (specific automation vs. all automations from all segments). It does not name any sibling tool to differentiate itself from, which keeps it just short of a 5.

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?

Gives clear conditional guidance on the parameter choice — pass `automation_sqid` for one automation, omit it to run everything across the lead's segments. It does not say when to prefer this over adjacent run-style siblings, nor any preconditions (lead state, opt-outs) that would make a run inappropriate.

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.