Skip to main content
Glama

Create or Update Lead

upsert_lead
Destructive

Create a new lead or update existing leads for the authenticated business, routed through the governed leads API (business access-checked, usage-logged, and audited). To create one, pass lead with at least one of name/phone/email plus optional status/source/notes/agent_id/etc. To update, pass updates: an array of { id, ...fields } for one or many existing leads (status, name, phone, email, notes, address, city, state, zip). Updates are access-checked per row and report partial success.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
leadNoFields for a NEW lead: name, first_name, last_name, phone, email, status, source, notes, address, city, state, zip, agent_id, message. At least one of name/phone/email is required.
updatesNoUpdate existing leads. Each item is { id, ...fields } where fields are a subset of name, first_name, last_name, email, phone, status, source, notes, address, city, state, zip. Max 100 per call.
business_idNoBusiness ID. Required for create when the API key can access multiple businesses.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
leadNo
errorNoPresent when success is false
failedNo
resultsNo
successYesWhether the tool completed successfully
updatedNo
operationNocreate or update

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (destructiveHint=true, readOnlyHint=false), the description adds valuable behavioral context: the API is governed with business access checks, usage logging, and auditing; updates are access-checked per row and report partial success. This is meaningful additional disclosure beyond what annotations provide.

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?

The description is two sentences, front-loaded with the primary purpose, and every clause adds useful information. No filler or redundancy.

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 mutation tool with nested objects and an output schema, the description is quite complete. It covers create/update behavior, requirements, access checks, and partial success. Minor gaps: it doesn't specify what happens if both 'lead' and 'updates' are provided, or error handling beyond partial success. Given the annotations and schema, this is adequate.

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 the baseline is 3. The description adds value by explaining the create vs. update distinction, the requirement that 'lead' must have at least one of name/phone/email, and the structure of 'updates' as an array of {id, ...fields}. While some of this is in the schema, the description ties it together and clarifies usage.

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 clearly states the tool creates or updates leads, with a specific verb and resource. It distinguishes between create (pass 'lead') and update (pass 'updates'), making its purpose unambiguous and differentiating it from read-only siblings like get_lead and list_leads.

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?

The description provides clear usage patterns: how to create (with required fields) and how to update (with array of updates). It implies when to use it (for any lead create/update) but doesn't explicitly mention alternatives or when not to use it. However, the context is clear enough that an agent can decide without further guidance.

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.