Skip to content

mcp_upsert_table

PhuocLe edited this page Jun 20, 2026 · 3 revisions

Summary

Field Value
Tool name upsert_table
MCP title Create or update a Dataverse table
Category advanced
Implementation DynamicsCrm.DevKit.Cli/Mcp/Tools/UpsertTableTool.cs
Estimated token count ~686 tokens (tools/list tool JSON, o200k_base, measured 2026-06-18)
Last verified 2026-06-18

MCP Tool Description (Exact)

Create or update a Dataverse table (auto-detect by entity lookup).
- CREATE (no entity): need display_name + display_collection_name + solution_name. Auto-creates primary name. Next: upsert_column → manage_form(action='update', operations=[...]).
- UPDATE (entity exists): need entity_name only. Mutable: display_name, display_collection_name, description, is_audit_enabled, is_quick_create_enabled, is_search_enabled. Others immutable.

CREATE uses the publisher prefix from solution_name directly. confirmed_prefix is optional and only validates the resolved prefix when supplied.

is_activity=true forces User ownership + notes + Subject primary attr.

WHEN TO USE:
- Create a new custom entity (table) with primary name attribute
- Update mutable metadata (display names, description, audit, quick create)
- Enable or disable Dataverse Search indexing for an existing table (is_search_enabled)
- Inspect existing table first via get_tables before update

FUZZY/AMBIGUITY:
- entity_name resolves Display Name contains first, then logical/schema name contains. solution_name uses the shared Display Name first solution resolver. Ambiguity returns IsError=true.

Parameters

Name Type Required Default Description
entity_name string Yes - Logical name with prefix ('new_project') OR just name with solution_name to auto-resolve.
display_name string No "" Singular (e.g. 'Project'). Required: create.
display_collection_name string No "" Plural (e.g. 'Projects'). Required: create.
solution_name string No "" Required: create.
confirmed_prefix string No "" Optional prefix validation for create. If supplied, it must match the solution publisher prefix.
description string No "" -
primary_attribute_name string No "" Auto-derived if omitted. [create-only]
primary_attribute_display_name string No "Name" [create-only]
ownership_type string No "User" 'User' or 'Organization'. [create-only, immutable]
table_type string No "Standard" 'Standard' or 'Elastic' (Cosmos DB, no charts). [create-only, immutable]
is_activity boolean No false Activity entity. [create-only, immutable]
has_notes boolean No false Enable notes. [create-only]
is_quick_create_enabled boolean? No - null = keep current (update).
is_audit_enabled boolean? No - null = keep current (update). Default true on create.
is_search_enabled boolean? No - Enable this table for Dataverse Search/Relevance Search (SyncToExternalSearchIndex). null = keep current on update; false by default on create unless specified.
primary_attribute_max_length integer No 100 1–850. [create-only]

Input Schema

{
  "type": "object",
  "properties": {
    "entity_name": {
      "type": "string",
      "description": "Logical name with prefix ('new_project') OR just name with solution_name to auto-resolve."
    },
    "display_name": {
      "type": "string",
      "description": "Singular (e.g. 'Project'). Required: create.",
      "default": ""
    },
    "display_collection_name": {
      "type": "string",
      "description": "Plural (e.g. 'Projects'). Required: create.",
      "default": ""
    },
    "solution_name": {
      "type": "string",
      "description": "Required: create.",
      "default": ""
    },
    "confirmed_prefix": {
      "type": "string",
      "description": "Optional prefix validation for create. If supplied, it must match the solution publisher prefix.",
      "default": ""
    },
    "description": {
      "type": "string",
      "description": "",
      "default": ""
    },
    "primary_attribute_name": {
      "type": "string",
      "description": "Auto-derived if omitted. [create-only]",
      "default": ""
    },
    "primary_attribute_display_name": {
      "type": "string",
      "description": "[create-only]",
      "default": "Name"
    },
    "ownership_type": {
      "type": "string",
      "description": "'User' or 'Organization'. [create-only, immutable]",
      "default": "User"
    },
    "table_type": {
      "type": "string",
      "description": "'Standard' or 'Elastic' (Cosmos DB, no charts). [create-only, immutable]",
      "default": "Standard"
    },
    "is_activity": {
      "type": "boolean",
      "description": "Activity entity. [create-only, immutable]",
      "default": false
    },
    "has_notes": {
      "type": "boolean",
      "description": "Enable notes. [create-only]",
      "default": false
    },
    "is_quick_create_enabled": {
      "type": "boolean",
      "description": "null = keep current (update)."
    },
    "is_audit_enabled": {
      "type": "boolean",
      "description": "null = keep current (update). Default true on create."
    },
    "is_search_enabled": {
      "type": "boolean",
      "description": "Enable this table for Dataverse Search/Relevance Search (SyncToExternalSearchIndex). null = keep current on update; false by default on create unless specified."
    },
    "primary_attribute_max_length": {
      "type": "integer",
      "description": "1–850. [create-only]",
      "default": 100
    }
  },
  "required": [
    "entity_name"
  ]
}

Related MCP Resources

Resource URI / URI template MIME type Reason
schema_tools_guide docs://schema_tools_guide text/markdown Inferred from source: Rules, type matrices, and immutable property lists for schema tools. Read this when upsert_table, upsert_column, or upsert_relationship returns an error.

When To Use

  • Create a new custom entity (table) with primary name attribute
  • Update mutable metadata (display names, description, audit, quick create)
  • Enable or disable Dataverse Search indexing for an existing table (is_search_enabled)
  • Inspect existing table first via get_tables before update

Notes

  • FUZZY/AMBIGUITY: entity_name resolves Display Name contains first, then logical/schema name contains. solution_name uses the shared Display Name first solution resolver. Ambiguity returns IsError=true.

Example

{
  "entity_name": "string"
}

Output

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

Prompt Examples

  • "Create a new user-owned custom table with notes enabled in this solution."
  • "Enable Dataverse Search for this existing table and publish metadata changes."
  • "Update this table display name and description without changing ownership."

Clone this wiki locally