Setup & diagnostics
Verify your PIT and probe every scope.
Verify the Topline Private Integration Token works and return basic location info. Call this first to confirm setup.
No parameters.
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_ping",
"arguments": {}
}
}
End-to-end setup verification for Topline MCP. Confirms the Private Integration Token is valid, resolves the location, and probes every major scope (contacts, conversations, opportunities, calendars, workflows, forms, surveys, users, custom fields, tags). Returns a structured pass/fail report so you can guide the user to fix any missing scopes. Call this immediately after a client finishes setup.
No parameters.
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_setup_check",
"arguments": {}
}
}
Generic passthrough to any Topline API v2 endpoint. Use this when no dedicated tool fits. Provide the path (e.g. "/contacts/" or "/opportunities/pipelines") and HTTP method. If the path or query needs a locationId and you don't provide one, the configured sub-account location is used automatically. Returns the parsed JSON response.
Parameters
| Field | Type | Description |
method required |
"GET" | "POST" | "PUT" | "PATCH" | "DELETE" |
HTTP method |
path required |
string |
API path, starting with '/'. Example: '/contacts/' or '/opportunities/123' |
query |
object |
nested properties |
body |
object |
nested properties |
injectLocationId |
boolean |
If true (default), auto-inject locationId into the query string when absent. Set false for endpoints that don't accept it. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_request",
"arguments": {
"method": "GET",
"path": "string"
}
}
}
Contacts
Create, search, and update contacts and their tags, notes, tasks, and workflow enrollments.
topline_search_contacts
#
Search contacts by free-text query (name, email, phone) and/or tag. Returns up to 100 per call with a cursor for pagination.
Parameters
| Field | Type | Description |
query |
string |
Free-text search: name, email, or phone |
tags |
array<string> |
Filter to contacts with ALL of these tags |
limit |
number |
Results per page (max 100, default 25) |
startAfterId |
string |
Cursor from a previous page |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_search_contacts",
"arguments": {
"query": "string",
"tags": [
"string"
]
}
}
}
Fetch a single contact by ID. Returns all standard fields and custom fields.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_get_contact",
"arguments": {
"contactId": "string"
}
}
}
Create a new contact. At minimum provide a name or email or phone. Custom fields go in customFields as {id, value} pairs.
Parameters
| Field | Type | Description |
firstName |
string |
|
lastName |
string |
|
name |
string |
Full name (use instead of firstName+lastName if you prefer) |
email |
string |
|
phone |
string |
E.164 format preferred, e.g. +14155551212 |
tags |
array<string> |
|
source |
string |
Attribution source (e.g. 'claude', 'website') |
customFields |
array<object> |
item properties| Field | Type | Description |
id |
string |
|
value |
any |
|
|
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_create_contact",
"arguments": {
"firstName": "string",
"lastName": "string"
}
}
}
Update fields on an existing contact.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
firstName |
string |
|
lastName |
string |
|
email |
string |
|
phone |
string |
|
tags |
array<string> |
REPLACES the tag list. Use add/remove tag tools for incremental changes. |
customFields |
array<object> |
item properties| Field | Type | Description |
id |
string |
|
value |
any |
|
|
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_update_contact",
"arguments": {
"contactId": "string"
}
}
}
Permanently delete a contact. Irreversible.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_delete_contact",
"arguments": {
"contactId": "string"
}
}
}
topline_add_contact_tags
#
Add one or more tags to a contact.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
tags required |
array<string> |
Tag names to add |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_add_contact_tags",
"arguments": {
"contactId": "string",
"tags": [
"string"
]
}
}
}
topline_remove_contact_tags
#
Remove one or more tags from a contact.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
tags required |
array<string> |
|
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_remove_contact_tags",
"arguments": {
"contactId": "string",
"tags": [
"string"
]
}
}
}
Create a contact, or update the existing one if email/phone matches. Use this when you're not sure whether the contact already exists.
Parameters
| Field | Type | Description |
firstName |
string |
|
lastName |
string |
|
email |
string |
|
phone |
string |
|
tags |
array<string> |
|
source |
string |
|
customFields |
array<object> |
item properties| Field | Type | Description |
id |
string |
|
value |
any |
|
|
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_upsert_contact",
"arguments": {
"firstName": "string",
"lastName": "string"
}
}
}
topline_add_contact_to_workflow
#
Enroll a contact in a workflow.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
workflowId required |
string |
Workflow ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_add_contact_to_workflow",
"arguments": {
"contactId": "string",
"workflowId": "string"
}
}
}
topline_remove_contact_from_workflow
#
Remove a contact from a workflow.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
workflowId required |
string |
Workflow ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_remove_contact_from_workflow",
"arguments": {
"contactId": "string",
"workflowId": "string"
}
}
}
topline_list_contact_tasks
#
List all tasks for a contact.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_list_contact_tasks",
"arguments": {
"contactId": "string"
}
}
}
topline_list_contact_notes
#
List all notes on a contact.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_list_contact_notes",
"arguments": {
"contactId": "string"
}
}
}
Conversations & messaging
Send SMS, email, WhatsApp, and DMs; read conversation history.
topline_search_conversations
#
Search conversations for the sub-account. Filter by contact, status, or query.
Parameters
| Field | Type | Description |
contactId |
string |
Only return conversations with this contact |
query |
string |
Free-text search |
status |
"all" | "read" | "unread" | "starred" | "recents" |
|
limit |
number |
Results per page (max 100, default 25) |
startAfterId |
string |
Cursor from a previous page |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_search_conversations",
"arguments": {
"contactId": "string",
"query": "string"
}
}
}
topline_get_conversation
#
Fetch a single conversation thread including recent messages.
Parameters
| Field | Type | Description |
conversationId required |
string |
Conversation ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_get_conversation",
"arguments": {
"conversationId": "string"
}
}
}
List messages in a conversation.
Parameters
| Field | Type | Description |
conversationId required |
string |
Conversation ID |
limit |
number |
Results per page (max 100, default 25) |
lastMessageId |
string |
Cursor for pagination |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_get_messages",
"arguments": {
"conversationId": "string"
}
}
}
Send a message (SMS, Email, WhatsApp, or Facebook/Instagram DM) to a contact. The contact must already exist.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
type required |
"SMS" | "Email" | "WhatsApp" | "IG" | "FB" | "Custom" | "Live_Chat" |
Channel to send through |
message |
string |
Plain-text message body (for SMS/chat channels) |
subject |
string |
Subject line (Email only) |
html |
string |
HTML body (Email only, takes precedence over message) |
attachments |
array<string> |
Public URLs to attach |
fromNumber |
string |
Sender phone number (SMS only, must be a number on the sub-account) |
toNumber |
string |
Override destination number (SMS only) |
emailFrom |
string |
Email from-address override |
emailTo |
string |
Email to-address override |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_send_message",
"arguments": {
"contactId": "string",
"type": "SMS"
}
}
}
topline_create_conversation
#
Create a new conversation with a contact (rarely needed — send_message usually creates one implicitly).
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_create_conversation",
"arguments": {
"contactId": "string"
}
}
}
Opportunities & pipelines
Move deals through pipeline stages, mark won/lost, set value.
List all opportunity pipelines in the sub-account with their stages.
Parameters
| Field | Type | Description |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_list_pipelines",
"arguments": {
"locationId": "string"
}
}
}
topline_search_opportunities
#
Search opportunities. Filter by pipeline, stage, status, contact, or free text.
Parameters
| Field | Type | Description |
query |
string |
Free-text search |
pipelineId |
string |
Restrict to one pipeline |
pipelineStageId |
string |
Restrict to one stage |
assignedTo |
string |
User ID |
contactId |
string |
|
status |
"open" | "won" | "lost" | "abandoned" | "all" |
|
limit |
number |
Results per page (max 100, default 25) |
startAfterId |
string |
Cursor from a previous page |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_search_opportunities",
"arguments": {
"query": "string",
"pipelineId": "string"
}
}
}
topline_get_opportunity
#
Fetch a single opportunity by ID.
Parameters
| Field | Type | Description |
opportunityId required |
string |
Opportunity ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_get_opportunity",
"arguments": {
"opportunityId": "string"
}
}
}
topline_create_opportunity
#
Create a new opportunity in a pipeline stage, associated with a contact.
Parameters
| Field | Type | Description |
pipelineId required |
string |
Pipeline ID |
pipelineStageId required |
string |
Pipeline stage ID |
contactId required |
string |
Contact ID |
name required |
string |
Opportunity name / title |
monetaryValue |
number |
Deal value in USD |
status |
"open" | "won" | "lost" | "abandoned" |
|
assignedTo |
string |
User ID to assign to |
tags |
array<string> |
|
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_create_opportunity",
"arguments": {
"pipelineId": "string",
"pipelineStageId": "string",
"contactId": "string",
"name": "string"
}
}
}
topline_update_opportunity
#
Update an opportunity — move stages, change value, mark won/lost, etc.
Parameters
| Field | Type | Description |
opportunityId required |
string |
Opportunity ID |
name |
string |
|
pipelineStageId |
string |
|
monetaryValue |
number |
|
status |
"open" | "won" | "lost" | "abandoned" |
|
assignedTo |
string |
|
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_update_opportunity",
"arguments": {
"opportunityId": "string"
}
}
}
topline_delete_opportunity
#
Delete an opportunity.
Parameters
| Field | Type | Description |
opportunityId required |
string |
Opportunity ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_delete_opportunity",
"arguments": {
"opportunityId": "string"
}
}
}
Calendars & appointments
Read calendar config, find slots, book appointments.
List all calendars configured on the sub-account.
Parameters
| Field | Type | Description |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_list_calendars",
"arguments": {
"locationId": "string"
}
}
}
topline_get_calendar_slots
#
Get available time slots for a calendar within a date range (ms epoch).
Parameters
| Field | Type | Description |
calendarId required |
string |
Calendar ID |
startDate required |
number |
Start timestamp (ms since epoch) |
endDate required |
number |
End timestamp (ms since epoch) |
timezone |
string |
IANA timezone (e.g. 'America/New_York') |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_get_calendar_slots",
"arguments": {
"calendarId": "string",
"startDate": 0,
"endDate": 0
}
}
}
topline_create_appointment
#
Book an appointment on a calendar for a contact.
Parameters
| Field | Type | Description |
calendarId required |
string |
Calendar ID |
contactId required |
string |
Contact ID |
startTime required |
string |
ISO 8601 start time, e.g. '2026-04-20T15:00:00-04:00' |
endTime |
string |
ISO 8601 end time (optional — inferred from calendar if omitted) |
title |
string |
Appointment title |
appointmentStatus |
"new" | "confirmed" | "cancelled" | "showed" | "noshow" | "invalid" |
|
assignedUserId |
string |
User ID to assign |
address |
string |
Location or meeting link |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_create_appointment",
"arguments": {
"calendarId": "string",
"contactId": "string",
"startTime": "string"
}
}
}
topline_update_appointment
#
Update an appointment (reschedule, change status, reassign).
Parameters
| Field | Type | Description |
appointmentId required |
string |
Appointment ID |
startTime |
string |
ISO 8601 |
endTime |
string |
ISO 8601 |
title |
string |
|
appointmentStatus |
"new" | "confirmed" | "cancelled" | "showed" | "noshow" | "invalid" |
|
assignedUserId |
string |
|
address |
string |
|
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_update_appointment",
"arguments": {
"appointmentId": "string"
}
}
}
topline_delete_appointment
#
Cancel and delete an appointment.
Parameters
| Field | Type | Description |
appointmentId required |
string |
Appointment ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_delete_appointment",
"arguments": {
"appointmentId": "string"
}
}
}
Get the full calendar definition (availability rules, team members, slot duration, etc.).
Parameters
| Field | Type | Description |
calendarId required |
string |
Calendar ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_get_calendar",
"arguments": {
"calendarId": "string"
}
}
}
topline_update_calendar
#
Update a calendar's name, description, slot duration, availability, team members, or event title. Pass only the fields you want to change. The calendar must already exist — calendar CREATE is not available under PIT (marketplace OAuth only).
Parameters
| Field | Type | Description |
calendarId required |
string |
Calendar ID |
name |
string |
New calendar name |
description |
string |
New description |
slug |
string |
URL slug (shows in public booking URLs) |
isActive |
boolean |
Enable / disable the calendar |
slotDuration |
number |
Appointment length in minutes |
slotBuffer |
number |
Buffer (minutes) between appointments |
eventTitle |
string |
Default event title template |
eventColor |
string |
Hex color shown in the UI |
appoinmentPerSlot |
number |
Max concurrent bookings per slot |
allowReschedule |
boolean |
|
allowCancellation |
boolean |
|
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_update_calendar",
"arguments": {
"calendarId": "string"
}
}
}
topline_delete_calendar
#
Delete a calendar. All future appointments on this calendar are cancelled. Past appointments are retained as historical records.
Parameters
| Field | Type | Description |
calendarId required |
string |
Calendar ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_delete_calendar",
"arguments": {
"calendarId": "string"
}
}
}
Tasks
Create and complete tasks against contacts.
Create a task associated with a contact.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
title required |
string |
Task title |
body |
string |
Task description / notes |
dueDate required |
string |
ISO 8601 due date |
assignedTo |
string |
User ID |
completed |
boolean |
Mark already-completed |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_create_task",
"arguments": {
"contactId": "string",
"title": "string",
"dueDate": "string"
}
}
}
Update a task — change title, body, due date, completion status.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
taskId required |
string |
Task ID |
title |
string |
|
body |
string |
|
dueDate |
string |
|
completed |
boolean |
|
assignedTo |
string |
|
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_update_task",
"arguments": {
"contactId": "string",
"taskId": "string"
}
}
}
Delete a task.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
taskId required |
string |
Task ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_delete_task",
"arguments": {
"contactId": "string",
"taskId": "string"
}
}
}
Notes
Add and update contact notes.
Create a note on a contact.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
body required |
string |
Note text |
userId |
string |
User ID to attribute the note to |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_create_note",
"arguments": {
"contactId": "string",
"body": "string"
}
}
}
Update the body of a note.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
noteId required |
string |
Note ID |
body required |
string |
New note text |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_update_note",
"arguments": {
"contactId": "string",
"noteId": "string",
"body": "string"
}
}
}
Delete a note.
Parameters
| Field | Type | Description |
contactId required |
string |
Contact ID |
noteId required |
string |
Note ID |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_delete_note",
"arguments": {
"contactId": "string",
"noteId": "string"
}
}
}
Custom fields
Define and manage custom fields on contacts and opportunities.
topline_list_custom_fields
#
List all custom fields configured on the sub-account (for contacts and opportunities). Useful before creating/updating contacts with custom data.
Parameters
| Field | Type | Description |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_list_custom_fields",
"arguments": {
"locationId": "string"
}
}
}
topline_get_custom_field
#
Get details of a single custom field.
Parameters
| Field | Type | Description |
customFieldId required |
string |
Custom field ID |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_get_custom_field",
"arguments": {
"customFieldId": "string"
}
}
}
topline_create_custom_field
#
Create a new custom field on the sub-account. After creation, the returned `id` can be referenced when setting custom-field values on contacts or opportunities. For SINGLE_OPTIONS / MULTIPLE_OPTIONS / RADIO / CHECKBOX fields, supply `options` as an array of {label, value} pairs.
Parameters
| Field | Type | Description |
name required |
string |
Display name (e.g. 'Deal Priority') |
dataType required |
string |
Field data type. One of: TEXT | LARGE_TEXT | NUMERICAL | PHONE | MONETORY | CHECKBOX | SINGLE_OPTIONS | MULTIPLE_OPTIONS | DATE | TEXTBOX_LIST | RADIO | FILE_UPLOAD | SIGNATURE. |
model |
string |
Object this field applies to: 'contact' or 'opportunity'. Default 'contact'. |
placeholder |
string |
Placeholder text shown on the field UI |
position |
string |
Render order (integer-as-string) |
options |
array<object> |
For SINGLE_OPTIONS / MULTIPLE_OPTIONS / RADIO / CHECKBOX: list of pickable values. item properties| Field | Type | Description |
label required |
string |
Option label |
value required |
string |
Option value (slug) |
|
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_create_custom_field",
"arguments": {
"name": "string",
"dataType": "string"
}
}
}
topline_update_custom_field
#
Update a custom field's name / options / placeholder. Pass only the fields you want to change.
Parameters
| Field | Type | Description |
customFieldId required |
string |
Custom field ID |
name |
string |
New display name |
placeholder |
string |
New placeholder |
position |
string |
New render order |
options |
array<object> |
Full replacement list for option-typed fields. item properties| Field | Type | Description |
label required |
string |
Option label |
value required |
string |
Option value (slug) |
|
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_update_custom_field",
"arguments": {
"customFieldId": "string"
}
}
}
topline_delete_custom_field
#
Delete a custom field. This removes the field definition but does not affect contact/opportunity rows that already have a value stored — those become orphaned data accessible only via raw_payload.
Parameters
| Field | Type | Description |
customFieldId required |
string |
Custom field ID |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_delete_custom_field",
"arguments": {
"customFieldId": "string"
}
}
}
Custom values
Sub-account custom values used as merge tags in workflows and messages.
topline_list_custom_values
#
List all sub-account custom values. Use before setting workflow merge tags or composing messages that reference {{custom_values.X}}.
Parameters
| Field | Type | Description |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_list_custom_values",
"arguments": {
"locationId": "string"
}
}
}
topline_get_custom_value
#
Get details of one custom value by id.
Parameters
| Field | Type | Description |
customValueId required |
string |
Custom value ID |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_get_custom_value",
"arguments": {
"customValueId": "string"
}
}
}
topline_create_custom_value
#
Create a new sub-account custom value. Returns the created record including its id and the auto-generated merge-tag key ({{custom_values.<slug>}}).
Parameters
| Field | Type | Description |
name required |
string |
Display name (e.g. 'Review Request Link') |
value required |
string |
The value to store. Used verbatim when merge tags are expanded. |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_create_custom_value",
"arguments": {
"name": "string",
"value": "string"
}
}
}
topline_update_custom_value
#
Update an existing custom value's name and/or value. Pass only the fields you want to change.
Parameters
| Field | Type | Description |
customValueId required |
string |
Custom value ID |
name |
string |
New display name |
value |
string |
New stored value |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_update_custom_value",
"arguments": {
"customValueId": "string"
}
}
}
topline_delete_custom_value
#
Delete a sub-account custom value. Any merge tags referencing the deleted key will render empty in workflows/messages.
Parameters
| Field | Type | Description |
customValueId required |
string |
Custom value ID |
locationId |
string |
Location (sub-account) ID. Defaults to TOPLINE_LOCATION_ID env var if omitted. |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_delete_custom_value",
"arguments": {
"customValueId": "string"
}
}
}
Analytics (SQL)
Read-only SQL surface over the sub-account data warehouse. Worker-only.
topline_describe_data_catalog
#
COMPLETE catalog of every Topline object that exists upstream — including objects we sync (queryable via SQL), objects we've catalogued but haven't built sync for yet, objects that require OAuth/agency scopes our PIT auth can't reach, and objects we've declined to sync. Call this when topline_describe_schema doesn't show something the user is asking about — it will tell you whether the data lives on disk (queryable now), is pending (answer will lag a sync cycle), or is inaccessible (tell the user to request it instead of inventing a workaround). Contrast with topline_describe_schema, which is SCHEMA-only and hides everything not currently exposed. Returns { entries: [{ name, category, status, description, sql_table?, endpoint?, notes? }...] } with status in {exposed, syncing, catalogued, requires_oauth, inaccessible, declined}.
No parameters.
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_describe_data_catalog",
"arguments": {}
}
}
topline_describe_schema
#
Overview of every table currently exposed to SQL queries in this sub-account's data warehouse. Returns table names, one-line descriptions, row counts, and a short SQLite-dialect cheat sheet. Call this FIRST when the user asks anything analytics-flavored ('how many', 'group by', 'trend', 'compare', 'duplicate'). It's cheap and tells you what's queryable. Follow up with topline_explain_tables on the ones you want to use, then topline_execute_query with the SQL.
No parameters.
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_describe_schema",
"arguments": {}
}
}
Per-column detail for one or more tables returned by topline_describe_schema. Gives column names, SQLite types, nullability, JSON-column flags, enum values for closed-set text columns, foreign-key hints for joins, and approximate row counts. Call this before writing a SELECT so your WHERE / JOIN clauses use real column names and valid enum values. Rejects tables that aren't in the exposed set.
Parameters
| Field | Type | Description |
tables required |
array<string> |
One or more table names to explain |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_explain_tables",
"arguments": {
"tables": [
"string"
]
}
}
}
Run a read-only SQL query against this sub-account's SQLite warehouse. ONE SELECT or WITH...SELECT statement at a time. DDL, DML, PRAGMA, ATTACH, and admin commands are rejected by the parser before they reach the database. Results are capped at 5000 rows; larger result sets come back with truncated: true. Returns { columns, rows, elapsed_ms, truncated, effective_limit, rewritten_sql }. SQLite dialect — no DATE_TRUNC (use strftime), JSON columns need json_extract / json_each, timestamps are ISO 8601 strings that compare lexicographically.
Parameters
| Field | Type | Description |
query required |
string |
A single SELECT or WITH ... SELECT statement. Example: "SELECT status, COUNT(*) AS n FROM opportunities GROUP BY status ORDER BY n DESC" |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_execute_query",
"arguments": {
"query": "string"
}
}
}
Describes the HTTP query API you can point Looker Studio, Retool, Lovable, Claude Code, n8n, or curl at for live-data dashboards. Returns URL shapes, auth format, example curl commands, and guidance for wiring up a dashboard. Use this when the user asks about building dashboards, embedding the data in another tool, or when a query is too complex for chat and they'd rather save it as a saved view.
No parameters.
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_utilize_api",
"arguments": {}
}
}
topline_find_references
#
Answer 'what uses X?' across synced CRM objects. Closed-enum dispatcher — runs hard-coded SQL per kind; no arbitrary SQL accepted. Supported kinds: tag, custom_field, custom_value, pipeline, pipeline_stage, calendar, user, contact, opportunity, form, survey. WORKFLOWS are NOT supported: the upstream platform's public API does not expose workflow internals, so we cannot know which workflows reference any given object. kind=opportunity returns ONLY direct references (the opportunity itself, its pipeline, stage, and contact) — it does NOT include downstream activity like messages or calls, since those belong to the contact and may span multiple opportunities. To get a contact's full activity, call this tool again with kind=contact using the contact_id from the opportunity's extra payload. Results are capped at 500 rows total (not per kind); truncated=true means upstream had more. For tags, accepts either the tag id or the tag name.
Parameters
| Field | Type | Description |
kind required |
"tag" | "custom_field" | "custom_value" | "pipeline" | "pipeline_stage" | "calendar" | "user" | "contact" | "opportunity" | "form" | "survey" |
|
id required |
string |
ID of the object to search references for (or name, for tags) |
Example call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "topline_find_references",
"arguments": {
"kind": "tag",
"id": "string"
}
}
}