servicenow-nodejs

v2.1.1
io.github.nickzitzer/servicenow-nodejs Checked 4 hours ago Published 1 year ago

Multi-instance ServiceNow MCP server with 40+ tools and intelligent schema discovery

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

SN-Set-Instance

Switch to a different ServiceNow instance. Use this at the start of your session to target a specific instance (dev, test, prod, etc.). Lists available instances if no name provided.

ParameterTypeDescription
instance_namestringName of the instance to switch to (e.g., "dev", "prod", "test"). Leave empty to list available instances.

SN-Get-Current-Instance

Get information about the currently active ServiceNow instance

SN-Query-Table

Query any ServiceNow table by name with flexible filtering

ParameterTypeDescription
table_name *stringServiceNow table name (e.g., "incident", "sys_user", "cmdb_ci") (required)
fieldsstringComma-separated list of fields to return (optional)
limitnumberMaximum number of records to return (default: 25)
offsetnumberNumber of records to skip for pagination (optional)
order_bystringField to sort by (e.g., "created_on" or "-priority" for descending) (optional)
querystringServiceNow encoded query string (e.g., "state=1^priority=1") (optional)

SN-Create-Record

Create a record in any ServiceNow table by name. WARNING: For catalog_ui_policy_action table, fields ui_policy and catalog_variable cannot be set via REST API - use SN-Execute-Background-Script with setValue() after creation.

ParameterTypeDescription
data *objectRecord data as key-value pairs (e.g., {"short_description": "Test", "priority": 1}) (required)
table_name *stringServiceNow table name (e.g., "incident", "sys_user", "cmdb_ci") (required)

SN-Get-Record

Get a specific record from any ServiceNow table by sys_id

ParameterTypeDescription
sys_id *stringSystem ID of the record to retrieve (required)
table_name *stringServiceNow table name (e.g., "incident", "sys_user", "cmdb_ci") (required)
fieldsstringComma-separated list of fields to return (optional)

SN-Update-Record

Update a record in any ServiceNow table by sys_id

ParameterTypeDescription
data *objectRecord data to update as key-value pairs (e.g., {"state": 6, "resolution_notes": "Fixed"}) (required)
sys_id *stringSystem ID of the record to update (required)
table_name *stringServiceNow table name (e.g., "incident", "sys_user", "cmdb_ci") (required)

SN-Get-Table-Schema

Get the schema/metadata for any ServiceNow table including required fields, common fields, and field descriptions

ParameterTypeDescription
table_name *stringServiceNow table name (required)

SN-List-Available-Tables

List all available ServiceNow tables with their descriptions and capabilities

ParameterTypeDescription
categorystringFilter by category: "core_itsm", "platform", "service_catalog", "cmdb", or "all" (optional)

SN-List-Incidents

List Incident records with filtering and pagination

ParameterTypeDescription
fieldsstringComma-separated list of fields to return (optional)
limitnumberMaximum number of records to return (default: 25)
offsetnumberNumber of records to skip for pagination (optional)
order_bystringField to sort by (e.g., "created_on" or "-priority" for descending) (optional)
prioritynumberFilter by priority (1-5) (optional)
querystringServiceNow encoded query string (e.g., "state=1^priority=1") (optional)
statestringFilter by state (e.g., "New", "In Progress", "Resolved") (optional)

SN-Create-Incident

Create a new Incident

ParameterTypeDescription
short_description *stringshort description (required)
assigned_tostringassigned to (optional)
assignment_groupstringassignment group (optional)
caller_idstringcaller id (optional)
categorystringcategory (optional)
descriptionstringdescription (optional)
impactstringimpact (optional)
prioritystringpriority (optional)
statestringstate (optional)
subcategorystringsubcategory (optional)
sys_created_bystringsys created by (optional)
sys_created_onstringsys created on (optional)
sys_updated_bystringsys updated by (optional)
sys_updated_onstringsys updated on (optional)
urgencystringurgency (optional)
work_notesstringwork notes (optional)

SN-Get-Incident

Get a Incident by ID

ParameterTypeDescription
sys_id *stringSystem ID

SN-List-SysUsers

List Sys User records with filtering and pagination

ParameterTypeDescription
fieldsstringComma-separated list of fields to return (optional)
limitnumberMaximum number of records to return (default: 25)
offsetnumberNumber of records to skip for pagination (optional)
order_bystringField to sort by (e.g., "created_on" or "-priority" for descending) (optional)
querystringServiceNow encoded query string (e.g., "state=1^priority=1") (optional)

SN-List-CmdbCis

List Cmdb Ci records with filtering and pagination

ParameterTypeDescription
fieldsstringComma-separated list of fields to return (optional)
limitnumberMaximum number of records to return (default: 25)
offsetnumberNumber of records to skip for pagination (optional)
order_bystringField to sort by (e.g., "created_on" or "-priority" for descending) (optional)
querystringServiceNow encoded query string (e.g., "state=1^priority=1") (optional)

SN-List-SysUserGroups

List Sys User Group records with filtering and pagination

ParameterTypeDescription
fieldsstringComma-separated list of fields to return (optional)
limitnumberMaximum number of records to return (default: 25)
offsetnumberNumber of records to skip for pagination (optional)
order_bystringField to sort by (e.g., "created_on" or "-priority" for descending) (optional)
querystringServiceNow encoded query string (e.g., "state=1^priority=1") (optional)

SN-List-ChangeRequests

List Change Request records with filtering and pagination

ParameterTypeDescription
fieldsstringComma-separated list of fields to return (optional)
limitnumberMaximum number of records to return (default: 25)
offsetnumberNumber of records to skip for pagination (optional)
order_bystringField to sort by (e.g., "created_on" or "-priority" for descending) (optional)
querystringServiceNow encoded query string (e.g., "state=1^priority=1") (optional)
statestringFilter by change state (optional)
typestringFilter by change type (e.g., "Normal", "Emergency") (optional)

SN-Set-Update-Set

Generate a fix script to set the current update set using GlideUpdateSet API. Cannot be done via REST API - creates script file for manual execution in ServiceNow UI.

ParameterTypeDescription
update_set_sys_id *stringSystem ID of the update set to make current (required)

SN-Get-Current-Update-Set

Get the currently active update set

SN-List-Update-Sets

List available update sets

ParameterTypeDescription
fieldsstringComma-separated list of fields to return (optional)
limitnumberMaximum number of records to return (default: 25)
offsetnumberNumber of records to skip for pagination (optional)
order_bystringField to sort by (e.g., "created_on" or "-sys_created_on" for descending) (optional)
querystringServiceNow encoded query string (e.g., "state=in progress") (optional)

SN-Set-Current-Application

Set the current application scope using the UI API. This changes which application is active for development and configuration changes.

ParameterTypeDescription
app_sys_id *stringSystem ID of the application to make current (required)

SN-List-Problems

List Problem records with filtering and pagination

ParameterTypeDescription
fieldsstringComma-separated list of fields to return (optional)
limitnumberMaximum number of records to return (default: 25)
offsetnumberNumber of records to skip for pagination (optional)
order_bystringField to sort by (e.g., "created_on" or "-priority" for descending) (optional)
querystringServiceNow encoded query string (e.g., "state=1^priority=1") (optional)

SN-Execute-Background-Script

🚀 EXECUTES background scripts with THREE methods: (1) sys_trigger [DEFAULT & MOST RELIABLE] - Creates scheduled job that runs in 1 second and auto-deletes, (2) UI endpoint (sys.scripts.do) - Attempts direct execution via UI, (3) Fix script - Manual fallback. Use for: setting update sets, complex GlideRecord operations, GlideUpdateSet API calls, etc. The sys_trigger method is most reliable and works consistently!

ParameterTypeDescription
script *stringJavaScript code to execute (required)
descriptionstringDescription of what the script does (optional)
execution_methodstringExecution method: "trigger" (default - most reliable), "ui" (UI endpoint), "auto" (try trigger then ui then fix script)

SN-Create-Fix-Script

⚠️ CREATES (not executes) a fix script file for MANUAL execution. ServiceNow REST API does NOT support direct script execution. This tool generates a .js file in /scripts/ directory with full instructions and optional auto-delete flag. You MUST manually copy and run the script in ServiceNow UI: System Definition → Scripts - Background. Use for: linking UI Policy Actions, setting update sets, complex GlideRecord operations that cannot be done via REST API.

ParameterTypeDescription
script_content *stringJavaScript code content (required)
script_name *stringName for the script file (e.g., "link_ui_policy_actions") (required)
auto_deletebooleanIf true, script file will be deleted after you confirm execution (default: false)
descriptionstringDescription of what the script does (optional)

SN-Discover-Table-Schema

Deep schema introspection with ServiceNow-specific metadata including type codes, choice tables, and relationships

ParameterTypeDescription
table_name *stringServiceNow table name (required)
include_business_rulesbooleanShow business rules for this table (optional)
include_choice_tablesbooleanShow which choice tables to use (optional)
include_field_constraintsbooleanShow field validations and defaults (optional)
include_relationshipsbooleanShow parent/child table relationships (optional)
include_type_codesbooleanShow internal type codes (e.g., 1=Choice, 5=Select Box) (optional)
include_ui_policiesbooleanShow UI policies affecting this table (optional)

SN-Batch-Create

Create multiple related records in one operation with variable references and transactional support. Reports progress during execution.

ParameterTypeDescription
operations *arrayArray of create operations. Each operation can reference previous operations via ${save_as_name}
progressbooleanReport progress notifications (default: true)
transactionbooleanAll-or-nothing transaction (default: true)

SN-Batch-Update

Update multiple records efficiently in a single operation. Reports progress during execution.

ParameterTypeDescription
updates *arrayArray of update operations
progressbooleanReport progress notifications (default: true)
stop_on_errorbooleanStop processing on first error (default: false)

SN-Explain-Field

Get comprehensive explanation of a specific field including type, constraints, and known issues

ParameterTypeDescription
field *stringField name (required)
table *stringTable name (required)
include_examplesbooleanInclude usage examples (default: true)

SN-Validate-Configuration

Validate catalog item configuration including variables, UI policies, and business rules

ParameterTypeDescription
catalog_item *stringCatalog item sys_id (required)
checksobjectValidation checks to perform

SN-Inspect-Update-Set

Inspect update set contents and verify completeness

ParameterTypeDescription
update_set *stringUpdate set sys_id (required)
show_componentsbooleanShow component breakdown (default: true)
show_dependenciesbooleanShow missing dependencies (default: false)

SN-Create-Workflow

Create a complete ServiceNow workflow with activities, transitions, and conditions. This tool orchestrates the entire workflow creation process: base workflow → version → activities → transitions → publish. Reports progress during creation.

ParameterTypeDescription
activities *arrayArray of activity definitions
name *stringWorkflow name (required)
table *stringTable this workflow runs against (e.g., "incident", "change_request")
conditionstringCondition for workflow to trigger (e.g., "state=1^priority=1") (optional)
descriptionstringWorkflow description (optional)
progressbooleanReport progress notifications (default: true)
publishbooleanPublish workflow after creation (default: false)
transitionsarrayArray of transition definitions (connects activities)

SN-Create-Activity

Create a single workflow activity with embedded JavaScript code. Use this for adding activities to existing workflows.

ParameterTypeDescription
name *stringActivity name (required)
workflow_version_sys_id *stringWorkflow version sys_id (required)
activity_definition_sys_idstringActivity type sys_id (optional - defaults to generic activity)
scriptstringJavaScript code to execute in this activity (optional)
xnumberX coordinate on canvas (default: 100)
ynumberY coordinate on canvas (default: 100)

SN-Create-Transition

Create a transition between two workflow activities with optional condition

ParameterTypeDescription
from_activity_sys_id *stringFrom activity sys_id (required)
to_activity_sys_id *stringTo activity sys_id (required)
condition_scriptstringJavaScript condition for this transition (optional)
ordernumberTransition order (default: 1)

SN-Publish-Workflow

Publish a workflow version, setting the start activity and making it active

ParameterTypeDescription
start_activity_sys_id *stringStarting activity sys_id (required)
version_sys_id *stringWorkflow version sys_id (required)

SN-Move-Records-To-Update-Set

Move sys_update_xml records to a different update set. Supports filtering by sys_ids, time range, or source update set. Extremely useful when records end up in wrong update set (e.g., "Default" instead of custom set). Reports progress during move operation.

ParameterTypeDescription
update_set_id *stringTarget update set sys_id to move records to (required)
progressbooleanReport progress notifications (default: true)
record_sys_idsarrayArray of sys_update_xml sys_ids to move (optional)
source_update_setstringFilter by source update set name (e.g., "Default") (optional)
tablestringTable name (default: sys_update_xml)
time_rangeobjectTime range to filter records (optional - format: YYYY-MM-DD HH:MM:SS)

SN-Clone-Update-Set

Clone an entire update set with all its sys_update_xml records. Creates a complete copy for backup, testing, or branching development work. Reports progress during cloning operation.

ParameterTypeDescription
new_name *stringName for the new cloned update set (required)
source_update_set_id *stringSource update set sys_id to clone (required)
progressbooleanReport progress notifications (default: true)

SN-Add-Comment

Add a comment to an incident. Accepts incident number for better UX.

ParameterTypeDescription
comment *stringComment text to add (required)
incident_number *stringIncident number (e.g., "INC0012345") (required)
instancestringInstance name (optional, uses default if not specified)

SN-Add-Work-Notes

Add work notes to an incident. Accepts incident number for better UX.

ParameterTypeDescription
incident_number *stringIncident number (e.g., "INC0012345") (required)
work_notes *stringWork notes text to add (required)
instancestringInstance name (optional, uses default if not specified)

SN-Assign-Incident

Assign an incident to a user and/or group. Resolves user names automatically.

ParameterTypeDescription
assigned_to *stringUser name or sys_id to assign to (required)
incident_number *stringIncident number (e.g., "INC0012345") (required)
assignment_groupstringAssignment group name or sys_id (optional)
instancestringInstance name (optional, uses default if not specified)

SN-Resolve-Incident

Resolve an incident with resolution notes and code.

ParameterTypeDescription
incident_number *stringIncident number (e.g., "INC0012345") (required)
resolution_notes *stringResolution notes describing the fix (required)
instancestringInstance name (optional, uses default if not specified)
resolution_codestringResolution code (e.g., "Solved (Permanently)", "Solved (Work Around)") (optional)

SN-Close-Incident

Close an incident with close notes and code.

ParameterTypeDescription
close_notes *stringClose notes (required)
incident_number *stringIncident number (e.g., "INC0012345") (required)
close_codestringClose code (e.g., "Solved (Permanently)", "Solved (Work Around)") (optional)
instancestringInstance name (optional, uses default if not specified)

SN-Add-Change-Comment

Add a comment to a change request. Accepts change number for better UX.

ParameterTypeDescription
change_number *stringChange request number (e.g., "CHG0012345") (required)
comment *stringComment text to add (required)
instancestringInstance name (optional, uses default if not specified)

SN-Assign-Change

Assign a change request to a user and/or group.

ParameterTypeDescription
assigned_to *stringUser name or sys_id to assign to (required)
change_number *stringChange request number (e.g., "CHG0012345") (required)
assignment_groupstringAssignment group name or sys_id (optional)
instancestringInstance name (optional, uses default if not specified)

SN-Approve-Change

Approve a change request.

ParameterTypeDescription
change_number *stringChange request number (e.g., "CHG0012345") (required)
approval_commentsstringComments for the approval (optional)
instancestringInstance name (optional, uses default if not specified)

SN-Add-Problem-Comment

Add a comment to a problem. Accepts problem number for better UX.

ParameterTypeDescription
comment *stringComment text to add (required)
problem_number *stringProblem number (e.g., "PRB0012345") (required)
instancestringInstance name (optional, uses default if not specified)

SN-Close-Problem

Close a problem with resolution information.

ParameterTypeDescription
problem_number *stringProblem number (e.g., "PRB0012345") (required)
resolution_notes *stringResolution notes (required)
instancestringInstance name (optional, uses default if not specified)
resolution_codestringResolution code (optional)