Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cometly.com/llms.txt

Use this file to discover all available pages before exploring further.

The Cometly MCP server exposes 50 read-only tools across 14 toolsets covering workspace context, analytics, journeys, ads-manager hierarchy, reports, segments, integrations, health, diagnostics, webhook debugging, and AI helpers. This page documents the public MCP surface — what Cursor, Claude Desktop, ChatGPT, and other external clients see after OAuth. The in-app Ask AI chat gets the same 50 tools plus additional internal-only capabilities (see below). Bulk extraction lives in the Public API V1 export endpoints and the in-app CSV export buttons — not in the MCP. Hand the dashboard URL to the user, or call the V1 export endpoints directly, instead of routing 50k rows through an LLM.

At a glance

Workspace

ToolBest for
get_workspace_contextOne cheap call that returns space name, timezone, currency, connected ad accounts, custom event labels, and default attribution. Call this at session start.
list_custom_eventsResolve “deals” → custom_event_2 so the agent never guesses slot ids.
list_my_spacesShow every space the authenticated user can access, with a marker on the current one.
list_metric_catalogEnumerate every supported analytics metric slug, scoped to what this space actually uses.
list_filterable_fieldsList every field that can appear in a filters object, with allowed operators per type.
list_user_defined_metricsList space-defined custom metric formulas (built in the report builder).
resolve_date_rangeTurn “last week” / “this month” / “Q1 2026” into concrete UTC bounds. Prevents off-by-one errors at DST boundaries.
ToolBest for
search_workspaceFuzzy search across campaigns, ad sets, ads, contacts, companies, reports, dashboards, segments.

Analytics

ToolBest for
query_ad_metricsPrimary tool for aggregated ad performance.
query_ad_metrics_compareTwo-period comparison (current vs previous) in one call.
query_attribution_modelsSame query across multiple attribution models.
query_metric_breakdown”Top N by X” ranked drill-down.

Events

ToolBest for
list_eventsIndividual conversion events.
get_eventSingle event detail.
query_events_aggregatedCounted / summed event totals bucketed by time + source.
list_event_typesDistinct event names + first/last seen + counts.

Contacts

ToolBest for
list_contactsCursor-paginated contact list with custom-field filtering.
get_contactSingle contact detail.
get_contact_journeyFull chronological timeline (touchpoints + conversions) for one contact.
query_contacts_aggregated”How many contacts converted from X last month?” aggregated rollups.

Companies

ToolBest for
list_companiesCompany-level rollup.
get_companySingle company detail.
get_company_journeyFull company-wide timeline with contact roster.

Ads Manager

ToolBest for
list_ad_accountsEvery connected ad account with currency + last sync.
list_campaignsCampaign roster across platforms.
list_adsetsAd sets / ad groups.
list_adsIndividual ads / creatives.
get_ad_entityFull campaign/adset/ad detail.

Reports

ToolBest for
list_dashboardsDashboards in this space.
get_dashboardOne dashboard + its reports.
list_reportsSaved reports across the space.
get_report_definitionA saved report’s full config.
run_saved_reportExecute a saved report as configured.
analyze_reportTuned AI narrative summary (deducts AI credits).
list_subscriptionsScheduled digest subscriptions.
get_subscription_last_runMost recent dispatched digest for a subscription.

Segments

ToolBest for
list_segmentsContact segments defined in the space.
get_segmentOne segment’s definition.
query_segment_membershipPaginated members of a segment.

Integrations

ToolBest for
list_integrationsEvery connected integration (OAuth + webhook).
get_pixel_statusPer-domain pixel + CAPI + form-tracking health.
list_event_mappingsHow external integration events map to Cometly events.

Health

ToolBest for
get_space_healthComposite tracking-health checklist.
debug_data_flowTrace why a specific event isn’t appearing.

Diagnostics

ToolBest for
inspect_siteServer-side crawl of a landing page for tracking installation.
verify_pixel_eventsConfirm pixel events are actually arriving from a domain.

Webhooks

ToolBest for
list_recent_webhooksRecent webhook receipts with status + summarized payload. PII redacted.
get_webhook_eventOne webhook fire with redacted payload + parse result.

AI helpers

ToolBest for
search_cometly_docsGrep over Cometly product docs for “how does X work?” questions.
get_chart_spec_templateChart.js v4 templates the agent fills in.
The in-app Ask AI chat also gets tools that are not on the public MCP transport:
ToolWhy it’s internal
list_recent_chats, get_chat_room, search_chat_historyOnly meaningful inside Cometly’s chat UI.
read_attachmentReads files uploaded to an Ask AI thread.
query_cohort_analysisCohort retention tables — Ask AI only for now.
remember_fact, forget_fact, search_memoryPersistent memory for Ask AI — registered separately, never exposed externally.
These are marked internal-only (external: false) or live only in the in-app agent registry. External MCP clients (Cursor, Claude Desktop, ChatGPT) won’t see them in tools/list.

Tool naming convention

PrefixMeaning
list_*Returns a cursor-paginated array. Tools accept a cursor parameter to walk the result set.
get_*Returns a single record by ID.
query_*Aggregated analytics — returns a result set shaped by metrics, group_by, and filters.
search_*Fuzzy search (lower-precision lookup helpers).
resolve_*Pure helpers that turn human-readable input into structured output.
debug_*Diagnostic, multi-source composition.
analyze_*Runs Cometly’s AI pipelines — deducts credits.

Output format

Most tools accept format: "csv" | "json" | "yaml". CSV is the default for tools added in v2.0 because it’s ~50% cheaper in tokens for tabular results. The legacy tools (list_events, list_contacts, query_ad_metrics, etc.) keep json as the default for backwards compatibility — pass format: "csv" explicitly when you want compactness. Token-budget pagination kicks in around ~6,000 tokens per tool response; when truncation happens the response includes a truncated_at_token_budget: true footer and an opaque next_cursor you should pass back verbatim.

Custom event awareness

Tools that touch custom events — list_events, query_ad_metrics, query_events_aggregated, and friends — automatically rewrite custom_event_* slot ids to your configured labels in their output. You can also pass labels directly:
{ "metrics": ["Deal Created", "purchase"] }
The server resolves “Deal Created” to its slot id (e.g. custom_event_2) on the way in. The result column header comes back as Deal Created, never the internal slug.

Authentication & errors

All external tools authenticate via the OAuth-issued Sanctum token described in Authentication. Errors come back as [error_class] message envelopes — see Rate Limits & Errors for the full taxonomy.