Skip to content

mcp_manage_record

PhuocLe edited this page Jun 20, 2026 · 3 revisions

Summary

Field Value
Tool name manage_record
MCP title Manage a single record (CRUD)
Category basic
Implementation DynamicsCrm.DevKit.Cli/Mcp/Tools/ManageRecordTool.cs
Estimated token count ~591 tokens (tools/list tool JSON, o200k_base, measured 2026-06-18)
Last verified 2026-06-18

MCP Tool Description (Exact)

CRUD single Dataverse record. Required: entity_name. create: +fields_json (returns GUID). read: +record_id, optional columns. update: +record_id+fields_json (partial supported). delete: +record_id (irreversible, may fail on FK or cascade-delete children). Use get_tables for field names; execute_fetchxml to find lookup GUIDs.

READ OUTPUT: action='read' returns selected field values in structuredContent.fields and also in text content. Use execute_webapi only when raw OData JSON, annotations, headers, or entity-set URL behavior is specifically needed.

LOOKUP / POLYMORPHIC LOOKUP SYNTAX in fields_json:
- Regular lookup (single target): {"fieldname": "guid"} — target entity resolved from metadata automatically
- Polymorphic lookup (multiple targets, e.g. Customer, Owner, or any custom poly lookup): use 'fieldname@targetentity' key to specify which target entity the GUID belongs to
  Syntax: {"fieldname@targetentity": "guid"}
  Examples: {"v5_billto@account": "<guid>"}, {"v5_billto@contact": "<guid>"}, {"ownerid@systemuser": "<guid>"}, {"v5_ref@devkit_custom1": "<guid>"}
- Never use @odata.bind format — use the fieldname@targetentity syntax above

WHEN TO USE:
- Create / read / update / delete a single record by GUID
- Partial-update specific fields without rewriting whole record
- Verify a record before destructive changes
- Use create_records instead for bulk (multiple records)

Parameters

Name Type Required Default Description
action string Yes - 'create', 'read', 'update', 'delete'.
entity_name string Yes - Entity logical name (e.g., 'account').
record_id string No "" GUID. Required: read/update/delete. Empty: create.
fields_json string No "" JSON object of field values. Required: create/update. Polymorphic lookup (multiple targets): 'fieldname@targetentity' key to specify target. Examples: {"v5_billto@account": ""}, {"ownerid@systemuser": ""}, {"v5_ref@devkit_custom1": ""}. Regular lookup (single target): {"fieldname": "guid"}.
columns string No "" Read only. Comma-separated columns. Empty = all.

Input Schema

{
  "type": "object",
  "properties": {
    "action": {
      "type": "string",
      "description": "'create', 'read', 'update', 'delete'."
    },
    "entity_name": {
      "type": "string",
      "description": "Entity logical name (e.g., 'account')."
    },
    "record_id": {
      "type": "string",
      "description": "GUID. Required: read/update/delete. Empty: create.",
      "default": ""
    },
    "fields_json": {
      "type": "string",
      "description": "JSON object of field values. Required: create/update. Polymorphic lookup (multiple targets): 'fieldname@targetentity' key to specify target. Examples: {\"v5_billto@account\": \"<guid>\"}, {\"ownerid@systemuser\": \"<guid>\"}, {\"v5_ref@devkit_custom1\": \"<guid>\"}. Regular lookup (single target): {\"fieldname\": \"guid\"}.",
      "default": ""
    },
    "columns": {
      "type": "string",
      "description": "Read only. Comma-separated columns. Empty = all.",
      "default": ""
    }
  },
  "required": [
    "action",
    "entity_name"
  ]
}

Related MCP Resources

Resource URI / URI template MIME type Reason
data_operations_guide docs://data_operations_guide text/markdown Inferred from source: Field type formats, FetchXML relationship joins, and search syntax. Read this when manage_record, execute_fetchxml, or search_records returns an error.

When To Use

  • Create / read / update / delete a single record by GUID
  • Partial-update specific fields without rewriting whole record
  • Verify a record before destructive changes
  • Use create_records instead for bulk (multiple records)

Notes

  • Use the exact MCP description and parameter schema above as the authoritative contract.

Example

{
  "action": "string",
  "entity_name": "string"
}

Output

Returns CallToolResult from the MCP server. The response content and structured fields follow the tool implementation and model returned by ManageRecordTool.manage_record.

Prompt Examples

  • "Read this account record and return only name, status, and owner fields."
  • "Create a contact linked to this account using the correct lookup syntax."
  • "Update this record with these field values and confirm the changed columns."

Clone this wiki locally