agentleFS
woyoruswoyorus/agent-skills/skills/close-crm/SKILL.md

close-crm

Skill0 starsChanged 8 months agoCC0-1.0View on GitHub

Use when the user wants to read, create, update, search, or delete data in Close (Close.com) CRM — leads, contacts, opportunities, activities (calls, emails, SMS, notes, meetings), tasks, sequences, smart views, custom fields, templates, pipelines, reports. Triggers on phrases like "in Close", "log this call", "create a lead", "advance the opportunity", "search Close for X", "Close CRM". Covers two transports — the official Close MCP server (primary) and the REST API at api.close.com (escape hatch) — plus scope selection, account discovery, and common workflow patterns.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the key is not in the environment when REST calls are needed, ask the user (do not echo it back).

    line 35
  2. Very specific:

    Always pipe through jq for inspection.

    line 79
  3. Distinctive:

    Every Close org is configured differently — pipelines, lead statuses, opportunity statuses, custom fields, and users all have org-specific …

    line 85
  4. Very specific:

    Always check has_more or cursor rather than assuming you got everything.

    line 205
  5. Distinctive:

    Always ask the user before:

    line 245
  6. Very specific:

    Discover before creating: Always fetch pipelines/statuses/users first.

    line 257
  7. Very specific:

    Custom-field endpoint is singular: Use /custom_field/<lead|contact|opportunity|activity|shared>/.

    line 262

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Close CRM Skill

Talks to Close (close.com) — a CRM for inside sales — through two transports:

  1. Close MCP server (https://mcp.close.com/mcp) — primary. Built and hosted by Close. ~50 tools covering leads/contacts/opportunities/activities/tasks/templates/pipelines/smart-views/reports plus a close_product_knowledge_search for the docs.
  2. Close REST API (https://api.close.com/api/v1/) — escape hatch for anything the MCP server doesn't expose (bulk actions, webhooks, file uploads, exports, raw event log, custom-object types, scheduling links, send-as identities, advanced reporting).

Default to MCP tools. Drop to REST only when no MCP tool fits.

Authentication

Both transports use the same API key, generated in Settings → Developer → API Keys in the Close web UI. Keys look like api_….

Environment variable

Store the key in CLOSE_API_KEY:

export CLOSE_API_KEY="api_..."

If the key is not in the environment when REST calls are needed, ask the user (do not echo it back).

Never log, echo, or paste the key

The key gives full org access. Use it only in the Close-API-Key MCP header or the REST Authorization: Basic header. Never print it in tool output, never write it to files inside the repo.

MCP setup (one-time)

Choose a scope:

ScopeAllowsUse when
mcp.readreads, searches, fetches, aggregationsexploring a new account, dashboards
mcp.write_safereads + create/update of leads, contacts, opportunities, tasks, templates, statuses, pipelines, smart views, sequencesmost agent work — no destructive risk
mcp.write_destructivesafe + delete of every above objectonly when the user explicitly authorizes deletes

Register the server (user scope, available in every project):

claude mcp add --scope user --transport http close \
  https://mcp.close.com/mcp \
  --header "Close-API-Key: $CLOSE_API_KEY" \
  --header "Close-Scope: mcp.write_safe"

Verify:

claude mcp get close          # should show "Status: ✓ Connected"

To change scope later, claude mcp remove close -s user and re-add. The MCP tool catalog Claude sees only refreshes at session start, so register before the session in which you want to use the tools.

For the full tool list grouped by scope, see references/mcp-tools.md.

REST setup

# Smoke-test
curl -s -u "$CLOSE_API_KEY:" https://api.close.com/api/v1/me/ | jq .email

HTTP Basic auth: API key as username, empty password. Note the trailing : — that's the empty password.

Always pipe through jq for inspection. JSON in, JSON out.

For the endpoint inventory, conventions, and worked examples, see references/rest-endpoints.md.

Discover the org first

Every Close org is configured differently — pipelines, lead statuses, opportunity statuses, custom fields, and users all have org-specific IDs. Before creating or updating anything, fetch the relevant config so you have real IDs to reference.

Via MCP (preferred): org_info, org_users, find_pipelines_and_opportunity_statuses, find_lead_statuses, find_lead_custom_fields, find_lead_smart_views.

Via REST:

B="https://api.close.com/api/v1"; K="$CLOSE_API_KEY:"
curl -s -u "$K" "$B/me/" | jq '{user:.email, org:.organizations[0].id}'
curl -s -u "$K" "$B/pipeline/" | jq '.data[] | {id, name, statuses: [.statuses[].label]}'
curl -s -u "$K" "$B/status/lead/" | jq '.data[] | {id, label}'
curl -s -u "$K" "$B/status/opportunity/" | jq '.data[] | {id, label, type}'
curl -s -u "$K" "$B/user/" | jq '.data[] | {id, email}'

Cache the IDs you'll reuse during the session — pipelines and statuses change rarely.

Core workflows

Create a lead with one contact

curl -s -u "$K" "$B/lead/" -H 'Content-Type: application/json' -d '{
  "name": "Acme Plumbing",
  "url": "https://acme-plumbing.example.com",
  "status_id": "stat_...",
  "contacts": [{
    "name": "Jane Owner",
    "title": "Owner",
    "emails":  [{"type": "office", "email": "jane@acme-plumbing.example.com"}],
    "phones":  [{"type": "office", "phone": "+14165550100"}]
  }],
  "addresses": [{
    "address_1": "123 Main St", "city": "Toronto",
    "state": "ON", "country": "CA", "zipcode": "M5V 1A1"
  }]
}' | jq '{id, name, display_name}'

MCP equivalent: create_lead (then create_contact if you need additional contacts).

Search for leads

REST uses a structured _query POSTed to /data/search/:

curl -s -u "$K" "$B/data/search/" -H 'Content-Type: application/json' -d '{
  "query": {
    "type": "and",
    "queries": [
      {"type": "object_type", "object_type": "lead"},
      {"type": "has_related", "this_object_type": "lead",
       "related_object_type": "contact",
       "related_query": {"type": "field_condition", "field": {"type": "regular_field", "object_type": "contact", "field_name": "email"},
                         "condition": {"type": "text", "mode": "full_words", "value": "acme"}}}
    ]
  },
  "_limit": 50, "_fields": {"lead": ["id", "display_name", "status_label"]}
}' | jq

For simple cases, prefer lead_search MCP tool or smart-view-based fetches via /saved_search/{id}/.

Log a call

curl -s -u "$K" "$B/activity/call/" -H 'Content-Type: application/json' -d '{
  "lead_id": "lead_...", "contact_id": "cont_...",
  "direction": "outbound", "status": "completed", "duration": 240,
  "note_html": "<body><p>Discussed scope. Sending estimate.</p></body>",
  "outcome_id": "outcome_..."
}' | jq

MCP: no dedicated call-create tool — use REST.

Send/log an email

curl -s -u "$K" "$B/activity/email/" -H 'Content-Type: application/json' -d '{
  "lead_id": "lead_...", "contact_id": "cont_...",
  "direction": "outbound", "status": "outbox",
  "subject": "Following up", "body_text": "Hi Jane, ...",
  "to": ["jane@acme-plumbing.example.com"],
  "sender": "Kirill <kirill@zerobooks.example>"
}' | jq

status: "outbox" queues the email for sending via Close. Use status: "sent" to log an already-sent email without re-sending.

Advance an opportunity

curl -s -u "$K" "$B/opportunity/oppo_.../" -X PUT -H 'Content-Type: application/json' \
  -d '{"status_id": "stat_..."}' | jq

MCP: update_opportunity. The opportunity moves between pipeline columns automatically based on the new status's pipeline.

Create a task

curl -s -u "$K" "$B/task/" -H 'Content-Type: application/json' -d '{
  "_type": "lead", "lead_id": "lead_...",
  "assigned_to": "user_...", "text": "Send proposal",
  "date": "2026-05-10", "is_complete": false
}' | jq

MCP: create_task.

For deeper end-to-end workflows (SMS, meetings, sequences, bulk imports, smart-view exports), see references/rest-endpoints.md.

Pagination

Two styles, depending on endpoint:

  • Offset/limit (most list endpoints): ?_skip=0&_limit=100. Response includes has_more boolean. Default _limit varies, max is usually 100 for list endpoints and 200 for some.
  • Cursor (search, event log, exports): response includes cursor (or data.cursor); pass it back as ?_cursor=… (or in the POST body for /data/search/). Do not increment a counter — always use the returned cursor.

Always check has_more or cursor rather than assuming you got everything.

Rate limits

Per endpoint group (e.g., GET /lead/ and POST /activity/email/ are separate buckets), per API key, with the org limit at 3× the per-key limit. Defaults are not published — read the response headers.

Modern header (RFC IETF):

RateLimit: limit=160; remaining=120; reset=8

Legacy headers (still emitted): x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset.

On 429 Too Many Requests: read the Retry-After header (seconds) and sleep that long before the next call to that endpoint group. Do not retry a different endpoint group — its bucket is separate.

For long-running batches: parallelize across endpoint groups, serialize within one group, and back off exponentially on every 429.

Error shape

{"error": "The requested URL was not found on the server. ..."}

Validation errors return 400 with {"error": "...", "field-errors": {"field_name": "..."}}. Always show the user the field-errors object — it pinpoints what to fix.

HTTPMeaning
200OK
201Created
400Validation — see field-errors
401Bad/missing API key
403Key lacks permission for this resource
404ID doesn't exist or wrong endpoint path
409Optimistic concurrency conflict
429Rate limited — honor Retry-After
5xxTransient — retry with backoff

Confirm before destructive operations

Always ask the user before:

  • delete_lead, delete_opportunity, delete_contact, delete_address
  • Deleting templates, pipelines, statuses, smart views, custom fields
  • Bulk delete, bulk edit, bulk email, bulk sequence-subscription
  • Anything that changes opportunity status to won/lost (irreversible in some downstream automations)
  • Anything that sends outbound (email with status: "outbox", SMS, sequence enrollment)

For a tight group of related operations on the same object, a single confirmation suffices. Do not chain confirmations into a yes-once-yes-always pattern.

Best practices

  1. Discover before creating. Always fetch pipelines/statuses/users first; never hard-code IDs from another org.
  2. Use MCP first, REST second. MCP returns shaped, scoped data; REST is verbose.
  3. Log activities, don't only mutate state. Logging a call/email/note keeps the lead timeline rich for the user.
  4. Custom fields are scoped per object. A custom field defined on lead cannot be set on opportunity directly — opportunities have their own custom-field namespace at /custom_field/opportunity/.
  5. Smart views are saved searches — endpoint is /saved_search/, not /smart_view/.
  6. Custom-field endpoint is singular. Use /custom_field/<lead|contact|opportunity|activity|shared>/. The plural /custom_fields/ works only for lead, contact, activity (legacy alias) — opportunity and shared 404 there.
  7. Phone numbers must be E.164 (+14165550100), or Close drops them silently on lead create.
  8. Activity creates take lead_id plus optional contact_id — both are needed for proper attribution.
  9. outcome_id on calls/meetings drives reporting — fetch outcomes via find_call_outcomes / find_meeting_outcomes before logging.
  10. Sequences are workflows. New API name is workflow; older docs say "sequence". Both work; MCP exposes find_workflows / create_workflow.
  11. Rich-text fields demand <body>...</body> wrapping. note_html (and description_html on some objects) reject bare <p>...</p> with 'HTML rich text fields in Close are expected to start with a "<body>" tag and end with "</body>"'. Wrap every rich-text payload in <body>...</body>. Email body_html is more forgiving but wrap it anyway for consistency.
  12. DELETE /lead/{id}/ cascades. It removes the lead AND every contact, opportunity, task, and activity attached to it. Asking for confirmation is required even if the user already approved the parent operation.

References

  • references/mcp-tools.md — full MCP tool catalog grouped by mcp.read / mcp.write_safe / mcp.write_destructive, with one-line purpose for each tool
  • references/rest-endpoints.md — REST endpoint inventory, URL conventions, the singular/plural custom-field gotcha, full activity-type list, search query DSL examples, export and event-log endpoints
  • Official docs: https://developer.close.com/
  • MCP docs: https://help.close.com/docs/mcp-server

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.