KosmoKrator

field-service

ServiceM8 CLI for AI Agents

Use the ServiceM8 CLI from KosmoKrator to call ServiceM8 tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 6 read 1 write Manual OAuth token auth

ServiceM8 CLI Setup

ServiceM8 can be configured headlessly with `kosmokrator integrations:configure service_m8`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure service_m8 --set access_token="$SERVICE_M8_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor service_m8 --json
kosmokrator integrations:status --json

Credentials

Authentication type: Manual OAuth token oauth2_manual_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token SERVICE_M8_ACCESS_TOKEN Secret secret yes Access Token
url SERVICE_M8_URL URL url no API Base URL

Call ServiceM8 Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call service_m8.servicem8_list_jobs '{
  "status": "example_status",
  "limit": 1,
  "offset": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:service_m8 servicem8_list_jobs '{
  "status": "example_status",
  "limit": 1,
  "offset": 1
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs service_m8 --json
kosmo integrations:docs service_m8.servicem8_list_jobs --json
kosmo integrations:schema service_m8.servicem8_list_jobs --json
kosmo integrations:search "ServiceM8" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to ServiceM8.

service_m8.servicem8_list_jobs

Read read

List jobs from ServiceM8. Returns job details including status, client, dates, and descriptions. Supports filtering by status and pagination.

Parameters
status, limit, offset

Generic CLI call

kosmo integrations:call service_m8.servicem8_list_jobs '{"status":"example_status","limit":1,"offset":1}' --json

Provider shortcut

kosmo integrations:service_m8 servicem8_list_jobs '{"status":"example_status","limit":1,"offset":1}' --json

service_m8.servicem8_get_job

Read read

Get detailed information about a specific ServiceM8 job by its UUID. Returns full job details including status, client, description, dates, and assigned staff.

Parameters
uuid

Generic CLI call

kosmo integrations:call service_m8.servicem8_get_job '{"uuid":"example_uuid"}' --json

Provider shortcut

kosmo integrations:service_m8 servicem8_get_job '{"uuid":"example_uuid"}' --json

service_m8.servicem8_list_clients

Read read

List clients from ServiceM8. Returns client details including name, email, phone, and address. Supports pagination.

Parameters
limit, offset

Generic CLI call

kosmo integrations:call service_m8.servicem8_list_clients '{"limit":1,"offset":1}' --json

Provider shortcut

kosmo integrations:service_m8 servicem8_list_clients '{"limit":1,"offset":1}' --json

service_m8.servicem8_get_client

Read read

Get detailed information about a specific ServiceM8 client by their UUID. Returns client details including name, email, phone, billing address, and notes.

Parameters
uuid

Generic CLI call

kosmo integrations:call service_m8.servicem8_get_client '{"uuid":"example_uuid"}' --json

Provider shortcut

kosmo integrations:service_m8 servicem8_get_client '{"uuid":"example_uuid"}' --json

service_m8.servicem8_create_job

Write write

Create a new job in ServiceM8. Requires a client UUID. Optionally specify a job template and description to pre-populate the job.

Parameters
client_id, template_id, description

Generic CLI call

kosmo integrations:call service_m8.servicem8_create_job '{"client_id":"example_client_id","template_id":"example_template_id","description":"example_description"}' --json

Provider shortcut

kosmo integrations:service_m8 servicem8_create_job '{"client_id":"example_client_id","template_id":"example_template_id","description":"example_description"}' --json

service_m8.servicem8_list_activities

Read read

List activity records from ServiceM8. Returns a timeline of events such as job status changes, comments, and notes. Supports filtering by job and pagination.

Parameters
job_uuid, limit, offset

Generic CLI call

kosmo integrations:call service_m8.servicem8_list_activities '{"job_uuid":"example_job_uuid","limit":1,"offset":1}' --json

Provider shortcut

kosmo integrations:service_m8 servicem8_list_activities '{"job_uuid":"example_job_uuid","limit":1,"offset":1}' --json

service_m8.servicem8_get_current_user

Read read

Get the profile of the currently authenticated ServiceM8 user. Returns name, email, role, and account details.

Parameters
none

Generic CLI call

kosmo integrations:call service_m8.servicem8_get_current_user '{}' --json

Provider shortcut

kosmo integrations:service_m8 servicem8_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

service_m8.servicem8_list_jobs

List jobs from ServiceM8. Returns job details including status, client, dates, and descriptions. Supports filtering by status and pagination.

Operation
Read read
Schema command
kosmo integrations:schema service_m8.servicem8_list_jobs --json
ParameterTypeRequiredDescription
status string no Filter by job status (e.g. "open", "in_progress", "completed", "cancelled").
limit integer no Maximum number of jobs to return per page.
offset integer no Number of records to skip for pagination.

service_m8.servicem8_get_job

Get detailed information about a specific ServiceM8 job by its UUID. Returns full job details including status, client, description, dates, and assigned staff.

Operation
Read read
Schema command
kosmo integrations:schema service_m8.servicem8_get_job --json
ParameterTypeRequiredDescription
uuid string yes The UUID of the job to retrieve.

service_m8.servicem8_list_clients

List clients from ServiceM8. Returns client details including name, email, phone, and address. Supports pagination.

Operation
Read read
Schema command
kosmo integrations:schema service_m8.servicem8_list_clients --json
ParameterTypeRequiredDescription
limit integer no Maximum number of clients to return per page.
offset integer no Number of records to skip for pagination.

service_m8.servicem8_get_client

Get detailed information about a specific ServiceM8 client by their UUID. Returns client details including name, email, phone, billing address, and notes.

Operation
Read read
Schema command
kosmo integrations:schema service_m8.servicem8_get_client --json
ParameterTypeRequiredDescription
uuid string yes The UUID of the client to retrieve.

service_m8.servicem8_create_job

Create a new job in ServiceM8. Requires a client UUID. Optionally specify a job template and description to pre-populate the job.

Operation
Write write
Schema command
kosmo integrations:schema service_m8.servicem8_create_job --json
ParameterTypeRequiredDescription
client_id string yes The UUID of the client to assign the job to.
template_id string no The UUID of a job template to apply.
description string no A description for the new job.

service_m8.servicem8_list_activities

List activity records from ServiceM8. Returns a timeline of events such as job status changes, comments, and notes. Supports filtering by job and pagination.

Operation
Read read
Schema command
kosmo integrations:schema service_m8.servicem8_list_activities --json
ParameterTypeRequiredDescription
job_uuid string no Filter activities to a specific job by its UUID.
limit integer no Maximum number of activities to return per page.
offset integer no Number of records to skip for pagination.

service_m8.servicem8_get_current_user

Get the profile of the currently authenticated ServiceM8 user. Returns name, email, role, and account details.

Operation
Read read
Schema command
kosmo integrations:schema service_m8.servicem8_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.