Agent Tools
The 26 organization-scoped tools shared by MCP, the tools REST API, and the local CLI.
One registry. MCP, GET/POST /api/v1/tools/{name}, and pnpm tools all
expose these 26 tools and run the existing Admin API. Setup is in
Configure AI Agents.
Each tool has a required API-key scope. A default dashboard key can run
the write-link and events:write tools, but not members, customers,
imports, domain writes, or archive.
Account
| Tool | Scope | HTTP |
|---|---|---|
get_organization | account:read | GET /api/v1/me |
Empty input. Use it as a connectivity check.
Members
Requires members:read, which is not on the default key.
| Tool | Scope | HTTP |
|---|---|---|
list_members | members:read | GET /api/v1/members |
get_member | members:read | GET /api/v1/members/:memberId |
get_member takes { "memberId": "…" }. See Members API.
Domains
| Tool | Scope | HTTP |
|---|---|---|
list_domains | domains:read | GET /api/v1/domains |
get_domain | domains:read | GET /api/v1/domains/:domainId |
create_domain | domains:write | POST /api/v1/domains |
update_domain | domains:write | PATCH /api/v1/domains/:domainId |
list_domains accepts { "cursor", "limit" } (1–100, default 50).
create_domain takes hostname, optional isPrimary, optional
fallbackUrl. A domain only starts redirecting once verification
succeeds. See Domains and Imports API.
Links
| Tool | Scope | HTTP |
|---|---|---|
list_links | links:read | GET /api/v1/links |
get_link | links:read | GET /api/v1/links/:linkId |
list_sublinks | links:read | GET /api/v1/links/:linkId/sublinks |
create_parent_link | links:write | POST /api/v1/links |
create_sublink | links:write | POST /api/v1/links/:linkId/sublinks |
update_link | links:write | PATCH /api/v1/links/:linkId |
archive_link | links:archive | DELETE /api/v1/links/:linkId |
create_parent_link requires domainId, slug, name,
destinationUrl, and idempotencyKey. Optional social fields: title,
description, imageUrl.
create_sublink requires parent linkId, slug, name, and
idempotencyKey. Optional: context, utmSource, utmMedium,
utmCampaign, utmTerm, utmContent.
update_link patches only the fields you send. A sublink cannot set
destinationUrl. archive_link is the only lifecycle delete; it is
marked destructive in MCP.
See Links API and Create a Link.
Analytics
| Tool | Scope | HTTP |
|---|---|---|
get_organization_analytics | analytics:read | GET /api/v1/analytics |
get_link_analytics | analytics:read | GET /api/v1/links/:linkId/analytics |
Both take optional dateFrom / dateTo as YYYY-MM-DD inclusive UTC
days, max 367 days. Link analytics is for a parent id. See
Analytics API.
Customers
Requires customers:read, not on the default key.
| Tool | Scope | HTTP |
|---|---|---|
list_customers | customers:read | GET /api/v1/customers |
get_customer_journey | customers:read | GET /api/v1/customers/:externalId |
list_customers accepts cursor, limit, optional linkId.
get_customer_journey uses your application’s externalId. See
Customers and Attribution and Events.
Events and tracking
| Tool | Scope | HTTP |
|---|---|---|
list_events | events:read | GET /api/v1/events |
create_event | events:write | POST /api/v1/events |
track_lead | events:write | POST /api/v1/track/lead |
track_sale | events:write | POST /api/v1/track/sale |
Funnel order is click → lead → sale. track_lead needs
externalCustomerId or customerEmail, plus idempotencyKey.
track_sale needs externalCustomerId, amount (minor units), and
either invoiceId or idempotencyKey.
list_events needs events:read, which the default key does not have.
track_lead / track_sale / create_event use events:write, which it
does.
Imports
Requires imports:read / imports:write. Neither is on the default key.
| Tool | Scope | HTTP |
|---|---|---|
list_imports | imports:read | GET /api/v1/imports |
get_import | imports:read | GET /api/v1/imports/:importId |
list_import_items | imports:read | GET /api/v1/imports/:importId/items |
create_import | imports:write | POST /api/v1/imports |
create_import takes source (csv | dub), domainId,
conflictStrategy (skip | update), and content (CSV text, ≤ 1 MB).
Returns 202. See Domains and Imports API.
Calling a tool
MCP: the client sends the tool name and a JSON object matching the input schema.
REST:
curl -X POST https://kliq.sh/api/v1/tools/track_lead \
-H "Authorization: Bearer $KLIQ_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"customerEmail": "user@example.com",
"eventName": "Waitlist",
"idempotencyKey": "waitlist-user-example"
}'Success: { "data": … }. Failure: { "message": "…" } with the Admin API
status (401, 403, 404, 409, 422, …).
CLI (pnpm tools in this repo). Reads KLIQ_API_KEY and KLIQ_API_URL
(or VITE_CONVEX_SITE_URL) and sends x-api-key plus x-tool-source: cli:
pnpm tools run track_lead '{"customerEmail":"user@example.com","eventName":"Waitlist","idempotencyKey":"waitlist-user-example"}'GET /api/v1/tools/{name} returns the JSON Schema, required scope, and
the underlying HTTP route. Use that when generating a skill or a typed
client instead of hard-coding argument names.