Skip to main content
Glama

CRM: Import leads

crm_import_leads
Destructive

Import up to 200 leads in one batch WITHOUT duplicates. Each row is matched against the workspace (same levels as crm_find_duplicates; or by 'lead_id' when you know it): a match is UPDATED — empty fields filled, filled ones never overwritten unless named in 'overwrite_fields' (reported as 'conflict:'), tags merged, status only moves forward ('stage_regression_ignored'); no match → CREATED; a weak match follows 'on_conflict' (merge = report as conflict and change nothing, skip, or create). Two rows of the batch with one key → the second is 'duplicate_in_batch'. 'custom' values are validated against crm_list_fields (EUR only for money; a 10-digit ЄДРПОУ is a personal code and is rejected, never stored). dry_run=true (DEFAULT) writes nothing and returns {summary, rows[{row, action, lead_id, match, reasons}]}. dry_run=false proposes the WHOLE batch for ONE confirm_action and applies it in one transaction; if the data changed before the confirm the confirm fails with plan_stale — call again. Same 'idempotency_key' → the same import is answered again. More than 200 rows → batch_too_large, nothing written: split the batch. CONFIRMATION: this tool is PROPOSED, never performed directly. You get status='confirmation_required' with an action_id and a plan_token, and the write happens only after confirm_action.

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": {
      "rows": "<rows>"
    },
    "name": "crm_import_leads"
  }
}

Input Schema

NameRequiredDescriptionDefault
rowsYes
dry_runNo
dedup_keysNo
on_conflictNo
source_labelNo
idempotency_keyNo
overwrite_fieldsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Far beyond the annotations: dry_run defaults to no writes, dry_run=false proposes one whole-batch confirm_action in a single transaction, plan_stale on stale data, idempotency_key replay, custom value validation (EUR-only money, 10-digit personal codes rejected), and 'stage_regression_ignored'. The write-with-confirmation and transactional semantics are exactly the context destructiveHint=true cannot convey. It stops short of describing what a propose-mode response looks like beyond confirmation_required.

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 batch limit and dedup guarantee, then the match/update/create rules, then dry-run and confirmation flow. It is dense but nearly every clause carries a behavioral rule; the parenthetical jargon ('conflict:<field>', 'stage_regression_ignored', 'duplicate_in_batch') is dense but functional rather than filler.

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?

Strong overall for a 7-parameter destructive mutation with no output schema, and it even sketches the dry_run return shape. But it never defines dedup_keys or source_label, and gives no description of what the propose-mode response contains beyond status and tokens, so an agent still has gaps when actually constructing the call.

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 description coverage is 0%, so the description must carry parameter meaning, and it does for most of them: on_conflict's three modes, overwrite_fields and its 'conflict:<field>' reporting, dry_run and its return shape, idempotency_key replay, and per-row matching via lead_id or workspace keys. dedup_keys and source_label are never mentioned, so two of the seven parameters remain undefined anywhere.

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 specific verb and resource plus a hard constraint: 'Import up to 200 leads in one batch WITHOUT duplicates.' It also distinguishes itself from crm_find_duplicates by reusing the same matching levels, so an agent knows this is the write path where that tool is the read path.

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 branching guidance: match + no overwrite_fields means fields are filled only, no match means create, weak match follows on_conflict, >200 rows means split the batch, and the data changing before confirm means re-call. It names crm_list_fields for validation and confirm_action as the completion step, leaving little to inference.

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.

Resources