Upsert ServiceNow record
servicenow_upsert_recordCreate or update a ServiceNow record by exact key/value match; ambiguous keys are refused, and expected action/sys_id checks prevent stale writes.
Instructions
Create or update one record matched by an exact key of field/value pairs: no match creates, one updates, several are refused (AMBIGUOUS_KEY). Pass the plan's expected_action / expected_sys_id with apply:true; a changed decision gives STALE_RECORD.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"table": "<table>",
"key": "<key>",
"values": "<values>"
},
"name": "servicenow_upsert_record"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Field/value pairs identifying the record, matched on raw values ('' matches an empty field); no '^' in values. | |
| apply | No | true executes; omitted: a non-mutating plan preview (SN_WRITE_MODE=apply executes by default). | |
| table | Yes | Table name, e.g. 'cmdb_ci_server'. | |
| values | Yes | Fields to write (plus the key fields on create). | |
| instance | No | Profile (default active) | |
| update_set | No | In-progress update set (sys_id or exact name) to capture the write in, restored after. Default SN_UPDATE_SET; data rows are never captured. | |
| expected_action | No | The plan's action; with apply, refused (STALE_RECORD) if the key now resolves differently. | |
| expected_sys_id | No | The plan's sys_id; with apply, refused (STALE_RECORD) if the key now matches another record or none. | |
| inputDisplayValue | No | Values are display values the instance resolves (sysparm_input_display_value); default false: raw. |