Skip to main content
Glama
servicenow-mcp-ai

servicenow-mcp-ai

by IvanBBaev

Upsert ServiceNow record

servicenow_upsert_record
Idempotent

Create 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

NameRequiredDescriptionDefault
keyYesField/value pairs identifying the record, matched on raw values ('' matches an empty field); no '^' in values.
applyNotrue executes; omitted: a non-mutating plan preview (SN_WRITE_MODE=apply executes by default).
tableYesTable name, e.g. 'cmdb_ci_server'.
valuesYesFields to write (plus the key fields on create).
instanceNoProfile (default active)
update_setNoIn-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_actionNoThe plan's action; with apply, refused (STALE_RECORD) if the key now resolves differently.
expected_sys_idNoThe plan's sys_id; with apply, refused (STALE_RECORD) if the key now matches another record or none.
inputDisplayValueNoValues are display values the instance resolves (sysparm_input_display_value); default false: raw.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.1.1
    • changedInput schema / properties / update_set / description
      Previous value: -"Update set (sys_id or exact name, in progress) to record the write in; switched for it, then restored. Default SN_UPDATE_SET, else unchanged. Data-row tables are not captured."New value: +"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."
  2. Addedv3.0.0

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With idempotentHint/destructiveHint already covering safety, the description adds genuinely new behavioral facts: multi-match is refused rather than guessed (AMBIGUOUS_KEY), and stale plans are rejected (STALE_RECORD). That tells the agent exactly how the tool behaves under ambiguity and concurrency, which annotations cannot express.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the core create-or-update contract, then the guardrail sentence. No restatement of the title or schema, and every clause carries a distinct rule or error code.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter write tool with no output schema, the description covers the decision logic and the two main failure modes, which is most of what an agent needs. It does not describe what a successful plan preview or apply returns, leaving the response shape unspecified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns more by explaining the interaction between parameters — key plus values determine create-vs-update, and apply combined with expected_action/expected_sys_id gates the write. The error code names attach concrete semantics to those pairings beyond the per-field schema text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb pair and resource ('Create or update one record') plus the matching contract ('matched by an exact key of field/value pairs'), which cleanly separates it from servicenow_create_record and servicenow_update_record. It stops short of naming those siblings explicitly, so an agent must infer the routing rather than being told it.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It conveys the plan-then-apply workflow ('Pass the plan's expected_action / expected_sys_id with apply:true') and the consequence of drift (STALE_RECORD), which is real usage context. It gives no explicit when-not guidance versus the dedicated create/update/query siblings, so it is short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.