Skip to main content
Glama
IvanBBaev

servicenow-mcp-ai

by IvanBBaev

Upsert ServiceNow record

servicenow_upsert_record
Idempotent

Create or update one ServiceNow record matched by exact field/value pairs. Ambiguous keys are refused, and stale plans are detected for safe 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.

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_setNoUpdate 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.
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. Addedv3.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the idempotentHint/destructiveHint annotations by disclosing the three-case match behavior, the AMBIGUOUS_KEY and STALE_RECORD error codes, and the fact that omitting apply produces a non-mutating preview plan. That is exactly the safety context an agent needs before a write.

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 tightly packed sentences, front-loaded with the create/update rule and the identity constraint, followed by the safety/plan mechanics. No filler or restatement of the title.

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 mutation tool with nested objects and no output schema, the description covers the decision-critical parts: match cardinality, preview vs apply, and stale-plan protection. Minor gaps remain around what a successful call returns (sys_id, created vs updated) and update_set side effects, which are only in the schema.

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 description coverage is 100%, so the baseline is 3, but the description still adds real meaning: it explains how expected_action/expected_sys_id pair with apply:true to produce STALE_RECORD, and that key matching is exact. It does not add detail on update_set or inputDisplayValue, but those are fully documented in the schema.

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

Purpose5/5

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

Starts with a specific verb pair and resource ("Create or update one record") and immediately defines the rule that separates it from servicenow_create_record and servicenow_update_record: matching by an exact key and the three cardinality outcomes. No ambiguity about what the tool does.

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?

Gives clear conditions to use it (key-based identity, plan/apply flow) and explains the refusal case for multiple matches. It never names the sibling create/update tools to say when to prefer them, so the agent must infer the choice rather than being routed explicitly.

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