Skip to content

MCP Overview

Klozeo implements the Model Context Protocol (MCP) — an open standard that lets AI assistants directly query and manipulate your lead database using natural language.

When you connect for the first time, your MCP client opens a browser window — sign in to your Klozeo account and authorize access. An API key is generated and stored automatically. You won’t need to copy-paste anything.

If you prefer to use an existing API key directly (for example, in a CI environment), each client setup guide includes manual instructions.

Klozeo uses the streamable HTTP transport (preferred by default). Claude Desktop is the exception — it requires the SSE transport because OAuth is not supported in that client. All other clients (Claude Code, Cursor, Cline, Roo Code, Goose, Smithery) use streamable HTTP.

ToolDescription
list_leadsList leads with filters, sorting, and pagination. Pass format: csv/json/xlsx to export all records without pagination
get_leadGet a specific lead by ID
create_leadCreate a new lead (deduplication automatic)
update_leadUpdate lead fields
delete_leadDelete a lead — requires confirm: true
create_lead_tagAdd a tag to a lead (idempotent)
ToolDescription
batch_create_leadsCreate up to 100/500 leads in one call (deduplication applied per item)
batch_update_leadsApply the same field update to multiple leads
batch_delete_leadsDelete multiple leads — requires confirm: true
ToolDescription
create_noteAdd a timestamped note to a lead
list_notesList all notes for a lead
update_noteEdit the content of an existing note
delete_noteDelete a note by ID — requires confirm: true
ToolDescription
list_attributesList all custom attributes for a lead
create_attributeAdd a custom attribute (text, number, bool, list, object)
update_attributeUpdate the value of an existing attribute
delete_attributeRemove a custom attribute — requires confirm: true
ToolDescription
list_scoring_rulesList all scoring rules
create_scoring_ruleCreate a new scoring rule with an expression
get_scoring_ruleGet a single scoring rule by ID
update_scoring_ruleUpdate a scoring rule’s name, expression, or priority
delete_scoring_ruleDelete a scoring rule — requires confirm: true
update_lead_scoreRecalculate and persist the score for a single lead
update_all_scoresRecalculate and persist scores for all leads
ToolDescription
list_webhooksList all webhook subscriptions
create_webhookCreate a new webhook subscription
delete_webhookDelete a webhook subscription — requires confirm: true
ToolDescription
list_api_keysList all API keys for your account
create_api_keyCreate a new named API key
delete_api_keyRevoke an API key — requires confirm: true
ToolDescription
get_statsGet aggregate account statistics
list_categoriesList all distinct lead categories
list_citiesList all distinct cities

Every tool returns structured JSON, which means AI agents can act on the result without guessing.

Success:

{ "data": { "id": "cl_abc123", "name": "Café du Marché", ... } }

Error:

{ "error": { "code": "RESOURCE_NOT_FOUND", "message": "Lead not found.", "status": 404 } }

Error codes are stable and machine-readable: RESOURCE_NOT_FOUND, VALIDATION_ERROR, UNAUTHORIZED, CONFLICT, RATE_LIMITED, INTERNAL_ERROR. An agent hitting a rate limit can read RATE_LIMITED and decide to retry — it doesn’t have to parse a prose string.

Destructive operations require confirmation

Section titled “Destructive operations require confirmation”

delete_lead, delete_note, and delete_webhook won’t execute unless confirm: true is passed. This means an AI agent can’t accidentally delete a record because it misread your intent — it has to be explicitly instructed to confirm.

If confirm is missing or false, the tool returns:

{ "error": { "code": "CONFIRMATION_REQUIRED", "message": "Set confirm: true to delete.", "status": 400 } }

In practice, you just tell the AI “delete lead X, confirm it” and it handles the parameter correctly.

list_leads accepts a sort parameter (not sort_by) for the field name, and sort_order for direction (ASC or DESC). Pass format: csv/json/xlsx to export all records without pagination.

List leads sorted by score descending

Claude will pass sort: "score", sort_order: "DESC" automatically.

Most MCP servers are written for humans to browse — long descriptions, inconsistent verb choices, free-form error strings. That works fine in a UI. In an agentic context, it costs tokens and causes tool selection mistakes.

A few specific decisions we made:

Consistent verb prefixes. Every tool name starts with list_, get_, create_, update_, or delete_. No synonyms, no exceptions. Models trained on natural language have strong priors on these verbs, which means fewer wrong tool selections and fewer retries.

Short, factual descriptions. Tool descriptions are capped at 80 characters. Parameter descriptions at 40. No examples, no preamble (“This tool allows you to…”). Just the action and the object. This keeps the tool manifest compact — 33 tools load comfortably within a single context window with room to spare for your actual task.

Machine-readable errors. Every error has a stable code field (RESOURCE_NOT_FOUND, RATE_LIMITED, etc.). An agent can branch on the code without parsing prose. This matters when building multi-step workflows where one tool’s failure should inform the next step.

Explicit confirmation for destructive ops. Delete tools require confirm: true. An agent that misunderstood “remove duplicates” won’t silently wipe records — it will get a CONFIRMATION_REQUIRED error and surface it to you before doing anything irreversible.

Single source of truth for schemas. Each tool’s parameter schema is defined once and shared across the MCP interface, the API, and the SDK types. Adding or changing a field touches one place — there’s no separate “MCP version” of the schema that can drift out of sync with what the API actually accepts.

These aren’t architectural novelties — they’re just the conventions the MCP spec recommends, applied consistently. The result is a server that agents use correctly on the first try more often, which means less back-and-forth and fewer unexpected outcomes for you.

Follow the guide for your AI client: