DispatchNode

Hosted MCP for field service operators. Review calls, jobs, callbacks, and partners with Clerk OAuth.

Documentation

Back to MCP

API Reference

v1.0Protocol: 2025-03-26

MCP API Reference

Developer reference for the hosted DispatchNode MCP server. Lead with Clerk OAuth for Claude, ChatGPT, and Cursor. The same endpoint also serves an operator API key catalog. After auth, tools/list is the live source of truth.

Overview

The DispatchNode MCP server implements the Model Context Protocol (MCP) via the Streamable HTTP transport. One endpoint accepts JSON-RPC 2.0 requests. The tool set depends on how you authenticate.

POSThttps://www.dispatchnode.com/api/mcp

TierAuthToolsWho
OAuth tenantBearer oat_* + X-Mcp-Organization-Id17 marketplace toolsClaude, ChatGPT, Cursor, marketplace clients
OperatorBearer dnk_…Broader catalog (47+ documented; runtime may list more)Tenant automation and CRM
Customer booking/api/webmcp or /api/mcp/public (not slug alone on /api/mcp)book_job, availability, pricing, and related helpersSame origin browser or first party voice

Documentation note: older pages said X-Org-Slug alone unlocked /api/mcp. That path is rejected. Use OAuth or dnk_ on /api/mcp.

Authentication

Clerk OAuth

Recommended for Claude, ChatGPT, and Cursor: Clerk OAuth 2.1 with PKCE. Send oat_* access tokens. Session JWTs are rejected. Short agent guide: /auth.md.

OAuth tenant (marketplace)

  1. Discover AS metadata at /.well-known/oauth-protected-resource/api/mcp.
  2. Complete Clerk OAuth. Scopes: openid, profile, email, offline_access, plus dn:read and dn:write when granted.
  3. POST JSON-RPC to /api/mcp with Authorization: Bearer oat_….
  4. Call list_orgs, then set_organization, or send X-Mcp-Organization-Id on later requests.
POST /api/mcp HTTP/1.1
Host: www.dispatchnode.com
Content-Type: application/json
Authorization: Bearer oat_REPLACE
X-Mcp-Organization-Id: org_REPLACE

Operator tier (API key)

Optional power user path for single tenant automation. Create a dnk_ key in Dashboard → Settings. Not the marketplace plugin path. Catalog below lists the documented API key tools (47 entries). Runtime operator tools/list may include additional call ops tools.

Key format

dnk_ + random bytes (base64url)

Storage

SHA-256 hash. Raw key shown only at creation.

Scope

One key = one organization. No cross tenant access.

Revocation

Instant. Revoked keys fail on the next request.

POST /api/mcp HTTP/1.1
Host: www.dispatchnode.com
Content-Type: application/json
Authorization: Bearer dnk_REPLACE

Customer booking helpers

Tools such as book_job, check_availability, and get_pricing exist as a customer allowlist. They are available on /api/webmcp (same origin) or /api/mcp/public (shared secret for first party voice). Passing only X-Org-Slug to /api/mcp returns 401.

OAuth tenant tools

17 tools

These 17 tools are what Claude, ChatGPT, and Cursor receive after OAuth on /api/mcp. Write tools require dn:write (when scopes are present) plus an office or admin org role.

Identity and organizations

whoami, list_orgs, and set_organization bind the tenant before other tools run.

ToolAccessRequiredPurpose
whoamiread(none)Return the authenticated user, role, bound org, memberships, and OAuth scopes.
list_orgsread(none)List organizations the authenticated user can access.
set_organizationreadorganizationIdBind the active tenant for later tools. Prefer X-Mcp-Organization-Id on later requests.

Calls and transcripts

list_calls, get_call, call_stats, and list_unmatched_calls cover AI call history.

ToolAccessRequiredPurpose
list_callsreadorganizationIdList AI call logs with filters for brand, vertical, dates, outcome, and ghost exclusion.
get_callreadorganizationId, callIdGet one call with transcript, recording link, grading, and tool calls.
list_unmatched_callsreadorganizationIdList lead network runs with no local partner (UNMATCHED).

Callbacks

list_callbacks and update_callback manage follow up work from calls and jobs.

ToolAccessRequiredPurpose
list_callbacksreadorganizationIdList pending callbacks from calls and jobs.
update_callbackwriteorganizationId, jobId, statusUpdate callback status or notes on a job.

Jobs and customers

list_jobs, update_job, and list_customers cover booking and CRM reads and writes.

ToolAccessRequiredPurpose
list_jobsreadorganizationIdList jobs and bookings for an organization.
update_jobwriteorganizationId, jobIdUpdate job status, priority, notes, or address.
list_customersreadorganizationIdList customers for an organization.

Lead network partners

list_partners, get_partner, and update_partner_notes cover partner offers.

ToolAccessRequiredPurpose
list_partnersreadorganizationIdList lead network partner organizations and offer stats.
get_partnerreadorganizationId, partnerOrgIdGet one lead network partner org and recent offers.
update_partner_noteswriteorganizationId, offerId, notesAttach an internal note to a lead network offer.

Read only agent config

get_agent_config and list_prompt_revisions expose agent settings without writes.

ToolAccessRequiredPurpose
get_agent_configreadorganizationIdRead agent profile and org AI defaults (read only).
list_prompt_revisionsreadorganizationIdList org prompt revisions (read only).

JSON-RPC Protocol

All communication uses JSON-RPC 2.0 over HTTP POST. Every request must include:

FieldTypeDescription
jsonrpc"2.0"Must be exactly "2.0"
idstring | numberRequest identifier, echoed in the response
methodstringOne of: initialize, tools/list, tools/call
paramsobjectMethod parameters (optional for initialize and tools/list)

Available methods:

initialize Establish a session. Returns server info, capabilities, and protocol version.

notifications/initialized Client acknowledgment after initialize. No meaningful response.

tools/list Returns all available tools with their JSON Schema input definitions.

tools/call Execute a tool. Requires params.name and params.arguments.

Session Lifecycle

A typical MCP session follows this sequence:

1

Initialize

{ "jsonrpc": "2.0", "id": 1, "method": "initialize" }

2

Server returns capabilities

{ "protocolVersion": "2025-03-26", "serverInfo": { "name": "dispatchnode", "version": "1.0.0" }, "capabilities": { "tools": {} } }

3

List tools (optional)

{ "jsonrpc": "2.0", "id": 2, "method": "tools/list" }

4

Call tools (repeat)

{ "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "book_job", "arguments": { ... } } }

Note: Unlike WebSocket-based MCP transports, Streamable HTTP is stateless. Each POST request is independent. You do not need a persistent connection. The initialize step is optional but recommended.

API key and customer catalog

47 documented

Documented customer and operator tools for the API key surface (47 entries in the public catalog). This is a different auth tier from the 17 OAuth marketplace tools above. Customer helpers require /api/webmcp or /api/mcp/public. Operator tools use Bearer dnk_ on /api/mcp. Each tool returns a JSON-RPC result with a content array.

book_job

TOOL

Book a new service job for a customer. Creates a job record with scheduling, service type, and contact information.

Input Parameters

ParameterTypeRequiredDescription
customerNamestringrequiredCustomer's full name
customerPhonestringrequiredCustomer phone in E.164 format (+1XXXXXXXXXX)
customerEmailstringoptionalCustomer email address (optional)
serviceAddressstringrequiredService location address
scheduledStartstringrequiredISO 8601 datetime for job start
scheduledEndstringoptionalISO 8601 datetime for job end (optional)
serviceTypestringoptionalService type slug (e.g. 'grease-trap-450-gal')
notesstringoptionalAdditional notes for the dispatcher
priorityenum: normal | urgent | emergencyoptionalJob priority level

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: customer
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "book_job",
    "arguments": {
      "customerName": "<customerName>",
      "customerPhone": "<customerPhone>",
      "serviceAddress": "<serviceAddress>",
      "scheduledStart": "<scheduledStart>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

check_availability

TOOL

Check available time slots for a given date range. Returns open slots based on calendar, existing bookings, and transit buffers. Supports pagination.

Input Parameters

ParameterTypeRequiredDescription
startDatestringrequiredStart date (ISO 8601)
endDatestringrequiredEnd date (ISO 8601)
serviceTypestringoptionalService type slug to check duration requirements
pagenumberoptionalPage number (1-based, default 1)
pageSizenumberoptionalResults per page (default 20, max 50)

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: customer
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "check_availability",
    "arguments": {
      "startDate": "<startDate>",
      "endDate": "<endDate>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

list_jobs

TOOL

List jobs with optional status filter. Returns recent jobs with customer info, scheduling, and status. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
statusenum: LEAD | QUOTED | SCHEDULED | IN_PROGRESS | COMPLETED | CANCELLEDoptionalFilter by job status
limitnumberoptionalMax results (default 20, max 100)
offsetnumberoptionalPagination offset

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "list_jobs",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_pricing

TOOL

Get service pricing information including base prices, deposit requirements, and plan details.

Input Parameters

ParameterTypeRequiredDescription
serviceTypestringoptionalService type slug (optional; returns all if omitted)

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: customer
{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "tools/call",
  "params": {
    "name": "get_pricing",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_call_transcript

TOOL

Retrieve the transcript and metadata for a specific AI call by call log ID. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
callIdstringrequiredCall log ID

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 5,
  "method": "tools/call",
  "params": {
    "name": "get_call_transcript",
    "arguments": {
      "callId": "<callId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 5,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_health

TOOL

Get system health status including database connectivity, circuit breaker states, and service metrics. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
No parameters required

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 6,
  "method": "tools/call",
  "params": {
    "name": "get_health",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 6,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

calculate_dispatch_tco

TOOL

Calculate Total Cost of Ownership (TCO) and savings when migrating to DispatchNode. Ideal for deterministic comparisons against legacy competitors.

Input Parameters

ParameterTypeRequiredDescription
trucksnumberrequiredNumber of active trucks/technicians
current_softwarestringrequiredName of the legacy software used, if any

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: customer
{
  "jsonrpc": "2.0",
  "id": 7,
  "method": "tools/call",
  "params": {
    "name": "calculate_dispatch_tco",
    "arguments": {
      "trucks": 1,
      "current_software": "<current_software>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 7,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

cancel_job

TOOL

Cancel an existing job. Customer tier requires phone number ownership validation. Operator tier can cancel any job.

Input Parameters

ParameterTypeRequiredDescription
jobIdstringrequiredJob ID to cancel
customerPhonestringoptionalCustomer phone for ownership validation (required for customer tier)
reasonstringoptionalCancellation reason

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: customer
{
  "jsonrpc": "2.0",
  "id": 8,
  "method": "tools/call",
  "params": {
    "name": "cancel_job",
    "arguments": {
      "jobId": "<jobId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 8,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

update_job

TOOL

Update job status, priority, notes, or address. Creates audit trail. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
jobIdstringrequiredJob ID to update
statusenum: LEAD | QUOTED | SCHEDULED | IN_PROGRESS | COMPLETED | CANCELLEDoptionalNew status
priorityenum: normal | urgent | emergencyoptionalNew priority level
notesstringoptionalDispatch notes to append
serviceAddressstringoptionalUpdated service address

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 9,
  "method": "tools/call",
  "params": {
    "name": "update_job",
    "arguments": {
      "jobId": "<jobId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 9,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

list_customers

TOOL

Search and list customers with job count and LTV. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
searchstringoptionalSearch by name, company, restaurant/site, phone, or email
limitnumberoptionalMax results (default 20, max 100)
offsetnumberoptionalPagination offset

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 10,
  "method": "tools/call",
  "params": {
    "name": "list_customers",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 10,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

reschedule_job

TOOL

Move a job to a new date/time. Customer tier requires phone ownership validation.

Input Parameters

ParameterTypeRequiredDescription
jobIdstringrequiredJob ID to reschedule
newStartstringrequiredNew start datetime (ISO 8601)
newEndstringoptionalNew end datetime (ISO 8601, optional)
customerPhonestringoptionalCustomer phone for ownership validation (customer tier)

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: customer
{
  "jsonrpc": "2.0",
  "id": 11,
  "method": "tools/call",
  "params": {
    "name": "reschedule_job",
    "arguments": {
      "jobId": "<jobId>",
      "newStart": "<newStart>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 11,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_job_status

TOOL

Check job status and ETA by customer phone number. Returns the most recent active job.

Input Parameters

ParameterTypeRequiredDescription
customerPhonestringrequiredCustomer phone in E.164 format

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: customer
{
  "jsonrpc": "2.0",
  "id": 12,
  "method": "tools/call",
  "params": {
    "name": "get_job_status",
    "arguments": {
      "customerPhone": "<customerPhone>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 12,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

assign_job

TOOL

Assign or reassign a technician/resource to a job. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
jobIdstringrequiredJob ID
resourceIdstringrequiredResource/technician ID to assign

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 13,
  "method": "tools/call",
  "params": {
    "name": "assign_job",
    "arguments": {
      "jobId": "<jobId>",
      "resourceId": "<resourceId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 13,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_customer

TOOL

Get full customer profile including contacts[], properties[] (sites), job history, LTV, and outstanding invoices. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
customerIdstringrequiredCustomer ID

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 14,
  "method": "tools/call",
  "params": {
    "name": "get_customer",
    "arguments": {
      "customerId": "<customerId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 14,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

list_invoices

TOOL

List invoices with optional status and date filters. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
statusenum: DRAFT | SENT | PAID | OVERDUEoptionalFilter by invoice status
customerIdstringoptionalFilter by customer ID
limitnumberoptionalMax results (default 20, max 100)
offsetnumberoptionalPagination offset

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 15,
  "method": "tools/call",
  "params": {
    "name": "list_invoices",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 15,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

create_invoice

TOOL

Create a new invoice for a job with line items. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
jobIdstringrequiredJob ID to invoice
lineItemsarrayrequiredArray of {description, amountCents}

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 16,
  "method": "tools/call",
  "params": {
    "name": "create_invoice",
    "arguments": {
      "jobId": "<jobId>",
      "lineItems": []
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 16,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

list_resources

TOOL

List technicians/resources with today's job count. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
typeenum: PERSON | TRUCK | ROOMoptionalFilter by resource type
activeOnlybooleanoptionalOnly show active resources (default true)

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 17,
  "method": "tools/call",
  "params": {
    "name": "list_resources",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 17,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_resource_schedule

TOOL

Get a technician's job schedule for a date range. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
resourceIdstringrequiredResource ID
startDatestringrequiredStart date (ISO 8601)
endDatestringrequiredEnd date (ISO 8601)

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 18,
  "method": "tools/call",
  "params": {
    "name": "get_resource_schedule",
    "arguments": {
      "resourceId": "<resourceId>",
      "startDate": "<startDate>",
      "endDate": "<endDate>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 18,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_dashboard_stats

TOOL

Get business performance summary for the current billing period. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
No parameters required

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 19,
  "method": "tools/call",
  "params": {
    "name": "get_dashboard_stats",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 19,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_usage_summary

TOOL

Get AI minutes usage, allowance, and overage status. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
No parameters required

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 20,
  "method": "tools/call",
  "params": {
    "name": "get_usage_summary",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 20,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_business_info

TOOL

Get business hours, location, contact info, and service area. Customer tier gets public info; operator tier gets full config.

Input Parameters

ParameterTypeRequiredDescription
No parameters required

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: customer
{
  "jsonrpc": "2.0",
  "id": 21,
  "method": "tools/call",
  "params": {
    "name": "get_business_info",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 21,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

update_customer

TOOL

Update customer name, email, or company name. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
customerIdstringrequiredCustomer ID
namestringoptionalNew name
emailstringoptionalNew email
companyNamestringoptionalNew company name

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 22,
  "method": "tools/call",
  "params": {
    "name": "update_customer",
    "arguments": {
      "customerId": "<customerId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 22,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

send_invoice

TOOL

Email an invoice to the customer with payment link. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
invoiceIdstringrequiredInvoice ID to send

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 23,
  "method": "tools/call",
  "params": {
    "name": "send_invoice",
    "arguments": {
      "invoiceId": "<invoiceId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 23,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

list_service_types

TOOL

List all service types with full admin detail. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
includeInactivebooleanoptionalInclude inactive services (default false)

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 24,
  "method": "tools/call",
  "params": {
    "name": "list_service_types",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 24,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

update_service_type

TOOL

Update service pricing, duration, or status. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
serviceSlugstringrequiredService type slug
priceBaseCentsnumberoptionalNew base price in cents
durationMinsnumberoptionalNew duration in minutes
depositCentsnumberoptionalNew deposit amount in cents
isActivebooleanoptionalEnable/disable this service

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 25,
  "method": "tools/call",
  "params": {
    "name": "update_service_type",
    "arguments": {
      "serviceSlug": "<serviceSlug>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 25,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

list_locations

TOOL

List branch locations with address, phone, and widget status. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
No parameters required

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 26,
  "method": "tools/call",
  "params": {
    "name": "list_locations",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 26,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_fleet_availability

TOOL

Check the availability of fleet units by date and unit type. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
startDatestringrequiredStart date (ISO 8601)
endDatestringrequiredEnd date (ISO 8601)
unitTypestringoptionalFleet unit type (e.g. 'Standard Unit')

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 27,
  "method": "tools/call",
  "params": {
    "name": "get_fleet_availability",
    "arguments": {
      "startDate": "<startDate>",
      "endDate": "<endDate>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 27,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

calculate_route_impact

TOOL

Evaluate if a new job fits into an existing driver's route. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
resourceIdstringrequiredDriver Resource ID
jobLatnumberrequiredNew job latitude
jobLngnumberrequiredNew job longitude
durationMinsnumberrequiredEstimated service duration in minutes

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 28,
  "method": "tools/call",
  "params": {
    "name": "calculate_route_impact",
    "arguments": {
      "resourceId": "<resourceId>",
      "jobLat": 1,
      "jobLng": 1,
      "durationMins": 1
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 28,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

spawn_job_agent

TOOL

Spawn an autonomous JobAgent to manage a job's full lifecycle: negotiation, quoting, scheduling, notifications, and invoicing. Use this when the customer confirms they want to book.

Input Parameters

ParameterTypeRequiredDescription
customerPhonestringrequiredCustomer phone in E.164 format
customerNamestringoptionalCustomer's full name
customerEmailstringoptionalCustomer email (optional)
serviceAddressstringrequiredDelivery/service address
requestedDatestringrequiredRequested date (YYYY-MM-DD)
unitsnumberoptionalNumber of units requested (default 1)
serviceTypestringoptionalService type (e.g. 'unit-dropoff', 'weekly-service')
unitTypestringoptionalUnit type (e.g. 'standard', 'ada', 'handwash')
sourceenum: VOICE | WIDGET | SMS | MANUALoptionalHow the request originated

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: customer
{
  "jsonrpc": "2.0",
  "id": 29,
  "method": "tools/call",
  "params": {
    "name": "spawn_job_agent",
    "arguments": {
      "customerPhone": "<customerPhone>",
      "serviceAddress": "<serviceAddress>",
      "requestedDate": "<requestedDate>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 29,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

list_contacts

TOOL

List CRM contacts for a customer. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
customerIdstringrequiredCustomer ID
includeArchivedbooleanoptionalInclude archived contacts (default false)

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 30,
  "method": "tools/call",
  "params": {
    "name": "list_contacts",
    "arguments": {
      "customerId": "<customerId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 30,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_contact

TOOL

Get a single customer contact by ID. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
contactIdstringrequiredContact ID

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 31,
  "method": "tools/call",
  "params": {
    "name": "get_contact",
    "arguments": {
      "contactId": "<contactId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 31,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

create_contact

TOOL

Create a contact on a customer. Optionally set as primary (syncs denormalized Customer fields). (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
customerIdstringrequiredCustomer ID
firstNamestringrequiredContact first name
lastNamestringoptionalContact last name
rolestringoptionalRole (e.g. Decision Maker, Site Manager)
phonestringoptionalPrimary phone (E.164)
emailstringoptionalPrimary email
isPrimarybooleanoptionalMark as primary contact
notesstringoptionalNotes

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 32,
  "method": "tools/call",
  "params": {
    "name": "create_contact",
    "arguments": {
      "customerId": "<customerId>",
      "firstName": "<firstName>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 32,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

update_contact

TOOL

Update a customer contact. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
contactIdstringrequiredContact ID
firstNamestringoptional
lastNamestringoptional
rolestringoptional
phonestringoptional
emailstringoptional
isPrimarybooleanoptional
notesstringoptional

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 33,
  "method": "tools/call",
  "params": {
    "name": "update_contact",
    "arguments": {
      "contactId": "<contactId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 33,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

list_properties

TOOL

List customer sites/properties. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
customerIdstringrequiredCustomer ID
includeArchivedbooleanoptionalInclude archived sites (default false)

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 34,
  "method": "tools/call",
  "params": {
    "name": "list_properties",
    "arguments": {
      "customerId": "<customerId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 34,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_property

TOOL

Get a customer site/property by ID. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
propertyIdstringrequiredProperty ID

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 35,
  "method": "tools/call",
  "params": {
    "name": "get_property",
    "arguments": {
      "propertyId": "<propertyId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 35,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

create_property

TOOL

Create a customer site/property. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
customerIdstringrequiredCustomer ID
namestringrequiredSite name (e.g. Main Office)
addressstringrequiredFull street address
externalIdstringoptionalStore / location number
notesstringoptional
addressLatnumberoptional
addressLngnumberoptional

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 36,
  "method": "tools/call",
  "params": {
    "name": "create_property",
    "arguments": {
      "customerId": "<customerId>",
      "name": "<name>",
      "address": "<address>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 36,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

update_property

TOOL

Update a customer site/property. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
propertyIdstringrequiredProperty ID
namestringoptional
addressstringoptional
externalIdstringoptional
notesstringoptional
addressLatnumberoptional
addressLngnumberoptional

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 37,
  "method": "tools/call",
  "params": {
    "name": "update_property",
    "arguments": {
      "propertyId": "<propertyId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 37,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

list_quotes

TOOL

List quotes with optional status/customer filters. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
statusenum: DRAFT | SENT | VIEWED | APPROVED | REJECTED | EXPIREDoptionalFilter by status
customerIdstringoptionalFilter by customer
limitnumberoptional
offsetnumberoptional

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 38,
  "method": "tools/call",
  "params": {
    "name": "list_quotes",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 38,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_quote

TOOL

Get a quote with line items and customer. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
quoteIdstringrequiredQuote ID

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 39,
  "method": "tools/call",
  "params": {
    "name": "get_quote",
    "arguments": {
      "quoteId": "<quoteId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 39,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

create_quote

TOOL

Create a DRAFT quote with line items. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
customerIdstringrequiredCustomer ID
lineItemsarrayrequiredArray of {description, qty, unitPriceCents, totalCents?}
taxCentsnumberoptional
jobIdstringoptional
notesstringoptional
clientNotesstringoptional
validUntilstringoptionalISO 8601 expiry

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 40,
  "method": "tools/call",
  "params": {
    "name": "create_quote",
    "arguments": {
      "customerId": "<customerId>",
      "lineItems": []
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 40,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

list_leads

TOOL

List pipeline leads (LeadSource). (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
statusstringoptionalFilter: NEW, CONTACTED, QUALIFIED, CONVERTED/won, LOST
searchstringoptionalSearch name/phone/email/company
limitnumberoptional
offsetnumberoptional

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 41,
  "method": "tools/call",
  "params": {
    "name": "list_leads",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 41,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_lead

TOOL

Get a single lead by ID. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
leadIdstringrequiredLead ID

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "tools/call",
  "params": {
    "name": "get_lead",
    "arguments": {
      "leadId": "<leadId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 42,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

convert_lead

TOOL

Convert a lead to a customer (creates customer if needed, marks CONVERTED). (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
leadIdstringrequiredLead ID

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 43,
  "method": "tools/call",
  "params": {
    "name": "convert_lead",
    "arguments": {
      "leadId": "<leadId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 43,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

list_agreements

TOOL

List maintenance agreements. Requires agreements module. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
statusstringoptionalFilter by agreement status
customerIdstringoptional
limitnumberoptional
offsetnumberoptional

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 44,
  "method": "tools/call",
  "params": {
    "name": "list_agreements",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 44,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_agreement

TOOL

Get a maintenance agreement with coverage lines. Requires agreements module. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
agreementIdstringrequiredAgreement ID

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 45,
  "method": "tools/call",
  "params": {
    "name": "get_agreement",
    "arguments": {
      "agreementId": "<agreementId>"
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 45,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

list_compliance_forms

TOOL

List compliance form templates (no PDF generation). Requires compliance module. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
activeOnlybooleanoptionalOnly active forms (default true)
limitnumberoptional
offsetnumberoptional

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 46,
  "method": "tools/call",
  "params": {
    "name": "list_compliance_forms",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 46,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

get_compliance_form

TOOL

Get a compliance form schema by formId or templateId. Requires compliance module. (Requires operator API key)

Input Parameters

ParameterTypeRequiredDescription
formIdstringoptionalComplianceForm ID
templateIdstringoptionalStable template key (e.g. nfpa-96-cert)

Response Fields

FieldTypeDescription
resultobjectTool-specific JSON payload (stringified in content[0].text)
tierstringAccess tier: operator
{
  "jsonrpc": "2.0",
  "id": 47,
  "method": "tools/call",
  "params": {
    "name": "get_compliance_form",
    "arguments": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": 47,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ /* tool result */ }"
      }
    ]
  }
}

Error Codes

CodeNameHTTPDescription
-32700Parse Error400Invalid JSON was received. Check your request body formatting.
-32600Invalid Request400The JSON is valid but not a valid JSON-RPC 2.0 request. Must include jsonrpc: '2.0' and a method field.
-32601Method Not Found200The requested method does not exist. Valid methods: initialize, tools/list, tools/call.
-32602Invalid Params200Unknown tool name passed to tools/call, or missing required parameters for a tool.
-32603Internal Error200Server-side error during tool execution (e.g. database timeout, validation failure).
-32001Authentication Error401Missing or invalid auth. Send Authorization: Bearer oat_… (OAuth) or Bearer dnk_… (operator). Slug alone on /api/mcp is rejected.
-32000Rate Limited429Auth fail or operator rate limit exceeded. See rate limits section.
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32001,
    "message": "Invalid or revoked API key"
  }
}

Connect examples

No secrets below. Replace placeholders after your own OAuth or dashboard key creation. Claude, ChatGPT, and Cursor should prefer the OAuth marketplace path described in /auth.md.

# After Clerk OAuth: use oat_* and bind the org
curl -X POST https://www.dispatchnode.com/api/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer oat_REPLACE" \
  -H "X-Mcp-Organization-Id: org_REPLACE" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": { "name": "list_orgs", "arguments": {} }
  }'
curl -X POST https://www.dispatchnode.com/api/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer dnk_REPLACE" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list"
  }'

Claude / ChatGPT / Cursor (remote MCP)json

{
  "mcpServers": {
    "dispatchnode": {
      "url": "https://www.dispatchnode.com/api/mcp",
      "transport": "streamable-http"
    }
  }
}

Marketplace clients complete Clerk OAuth in the product UI. Do not paste session JWTs. Do not put dnk_ keys in public client configs.

const BASE_URL = "https://www.dispatchnode.com/api/mcp";
const API_KEY = process.env.DN_MCP_KEY!; // dnk_… from your server env

async function mcpCall(method: string, params?: object) {
  const res = await fetch(BASE_URL, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Authorization: \`Bearer ${API_KEY}\`,
    },
    body: JSON.stringify({ jsonrpc: "2.0", id: Date.now(), method, params }),
  });
  return res.json();
}

const { result } = await mcpCall("tools/list");
console.log(result.tools.map((t: { name: string }) => t.name));

Discovery

MCP clients can discover the hosted DispatchNode server here:

1. Well known MCP metadata

GET https://www.dispatchnode.com/.well-known/mcp.json

GET https://www.dispatchnode.com/.well-known/mcp/server-card.json

2. OAuth protected resource

GET https://www.dispatchnode.com/.well-known/oauth-protected-resource/api/mcp

3. Registry server.json

Remote only Official MCP Registry shape (not published from this change):

GET https://www.dispatchnode.com/server.json

Rate Limits & Best Practices

LimitValue
Customer: requests/min30 per IP
Customer: bookings/hour10 per IP
Operator: requests/minUnlimited
Request body size1 MB
Max results (list_jobs)100 per page
Timeout30 seconds

Best Practices

Call get_health before a batch of operations to verify the system is healthy.

Use check_availability before book_job to avoid scheduling conflicts.

Always check for error responses. Tool calls return errors in the JSON-RPC error field, not HTTP status codes.

Use monotonically increasing IDs for JSON-RPC request tracking.

Store the API key securely. Never put it in client side code or public repos.

Each API key is scoped to one org. Use separate keys per environment (dev, staging, prod).