Skip to main content
Glama
Kenny-666

Dynamics 365 MCP Server

by Kenny-666

upsert_record_by_key

Destructive

Creates or updates a Dynamics 365 record by active alternate key, validating key metadata and types to prevent silent key changes. Races return errors; no automatic write retry.

Instructions

Use one active native alternate key with conditional PATCH. Validates key metadata/types and never silently changes key values. Races return errors; writes are never automatically repeated.

Input Schema

NameRequiredDescriptionDefault
dataYesNative JSON attribute data. Related bindings must stay inside the configured organization API. Local JSON limit 10 MiB.
modeNoDefault upsert. Uses native conditional PATCH: create-only if absent, guarded update if present. No automatic retry on races.
dryRunNoCompatibility alias for dry_run. Conflicting aliases are rejected.
dry_runNoRead-only preview of environment, target, changes and write blockers. Default false; sensitive fields are masked.
ifMatchNoCompatibility alias for if_match. Conflicting aliases are rejected.
if_matchNoSpecific ETag from a prior read/preview. Without it, reads the current record ETag when the table supports concurrency.
alternateKeyNoCompatibility alias for alternate_key. Conflicting aliases are rejected.
alternate_keyNoExact values for one declared active alternate key. Native metadata determines string/integer/choice/decimal/UTC datetime/lookup encoding. No null values.
collectionNameNoCompatibility alias for collection_name. Conflicting aliases are rejected.
collection_nameNoNative EntitySetName, such as accounts. Validated against table metadata.
allowUnprotectedWriteNoCompatibility alias for allow_unprotected_write. Conflicting aliases are rejected.
allow_unprotected_writeNoDefault false. Explicitly allow an unprotected write if table concurrency is unconfirmed, or for collection relationship membership. Does not bypass a supplied ETag conflict.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, and the description reinforces this by stating races return errors and writes are never automatically repeated, plus that key values are never silently changed and key metadata/types are validated. This adds real behavioral context beyond the annotations without contradicting them. It stops short of stating auth/privilege requirements.

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

Conciseness4/5

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

Three short sentences with no wasted words, and the key constraint about using one active alternate key is front-loaded. However, the compression makes the opening phrase cryptic rather than clear, trading readability for brevity.

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

Completeness3/5

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

For a 12-parameter mutation tool with a nested data object and no output schema, the description covers key behavioral rules (validation, races, no retry) but says nothing about the response shape or what a successful upsert returns. It is adequate but leaves the agent guessing about outcomes.

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

Parameters3/5

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

Schema description coverage is 100%, so parameters like mode, dry_run, if_match, and alternate_key are already well documented in the schema. The description adds only light framing (single active alternate key, conditional PATCH) rather than meaning beyond the schema, which fits the baseline 3.

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

Purpose3/5

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

The description says 'Use one active native alternate key with conditional PATCH' and mentions writes, but never states the core action plainly (create-or-update a record identified by an alternate key). It relies on the tool name to convey purpose and only implies that it mutates data. The mechanism (conditional PATCH) is stated, but the resource/operation pairing is left implicit.

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

Usage Guidelines2/5

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

There is a constraint ('Use one active native alternate key') but no guidance on when to choose this over siblings like create_new_record, update_existing_record, or execute_record_transaction. No prerequisites or exclusions are offered, leaving the agent to infer selection from the name alone.

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

Deploy Server

Other Tools