Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

Update Dataverse Table

update_dataverse_table

Modify existing Dataverse table properties including display names, descriptions, and feature settings like activities, notes, auditing, and duplicate detection.

Instructions

Updates the properties and configuration of an existing Dataverse table. Use this to modify table settings like display names, descriptions, or feature enablement (activities, notes, auditing, etc.). Changes are published automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoNew description of the table
displayCollectionNameNoNew display collection name for the table
displayNameNoNew display name for the table
hasActivitiesNoWhether the table can have activities
hasNotesNoWhether the table can have notes
isAuditEnabledNoWhether auditing is enabled
isConnectionsEnabledNoWhether connections are enabled
isDocumentManagementEnabledNoWhether document management is enabled
isDuplicateDetectionEnabledNoWhether duplicate detection is enabled
isMailMergeEnabledNoWhether mail merge is enabled
isValidForQueueNoWhether records can be added to queues
logicalNameYesLogical name of the table to update

Implementation Reference

  • Executes the tool logic: Retrieves existing table metadata, merges provided updates for display names, descriptions, and feature flags (activities, notes, audit, etc.), performs a PUT request with MSCRM.MergeLabels header to update labels safely, publishes the customization, and returns success or error response.
    async (params) => {
      try {
        // First, retrieve the current entity definition
        const currentEntity = await client.getMetadata<EntityMetadata>(
          `EntityDefinitions(LogicalName='${params.logicalName}')`
        );
    
        // Create the updated entity definition by merging current with new values
        const updatedEntity: any = {
          ...currentEntity,
          "@odata.type": "Microsoft.Dynamics.CRM.EntityMetadata"
        };
    
        // Update only the specified properties
        if (params.displayName) {
          updatedEntity.DisplayName = createLocalizedLabel(params.displayName);
        }
        if (params.displayCollectionName) {
          updatedEntity.DisplayCollectionName = createLocalizedLabel(params.displayCollectionName);
        }
        if (params.description) {
          updatedEntity.Description = createLocalizedLabel(params.description);
        }
        if (params.hasActivities !== undefined) {
          updatedEntity.HasActivities = params.hasActivities;
        }
        if (params.hasNotes !== undefined) {
          updatedEntity.HasNotes = params.hasNotes;
        }
        if (params.isAuditEnabled !== undefined) {
          updatedEntity.IsAuditEnabled = {
            Value: params.isAuditEnabled,
            CanBeChanged: true,
            ManagedPropertyLogicalName: "canmodifyauditsettings"
          };
        }
        if (params.isDuplicateDetectionEnabled !== undefined) {
          updatedEntity.IsDuplicateDetectionEnabled = {
            Value: params.isDuplicateDetectionEnabled,
            CanBeChanged: true,
            ManagedPropertyLogicalName: "canmodifyduplicatedetectionsettings"
          };
        }
        if (params.isValidForQueue !== undefined) {
          updatedEntity.IsValidForQueue = {
            Value: params.isValidForQueue,
            CanBeChanged: true,
            ManagedPropertyLogicalName: "canmodifyqueuesettings"
          };
        }
        if (params.isConnectionsEnabled !== undefined) {
          updatedEntity.IsConnectionsEnabled = {
            Value: params.isConnectionsEnabled,
            CanBeChanged: true,
            ManagedPropertyLogicalName: "canmodifyconnectionsettings"
          };
        }
        if (params.isMailMergeEnabled !== undefined) {
          updatedEntity.IsMailMergeEnabled = {
            Value: params.isMailMergeEnabled,
            CanBeChanged: true,
            ManagedPropertyLogicalName: "canmodifymailmergesettings"
          };
        }
        if (params.isDocumentManagementEnabled !== undefined) {
          updatedEntity.IsDocumentManagementEnabled = params.isDocumentManagementEnabled;
        }
    
        // Use PUT method with MSCRM.MergeLabels header as per Microsoft documentation
        await client.putMetadata(`EntityDefinitions(LogicalName='${params.logicalName}')`, updatedEntity, {
          'MSCRM.MergeLabels': 'true'
        });
    
        // Publish the changes as required by the API
        await client.callAction('PublishXml', {
          ParameterXml: `<importexportxml><entities><entity>${params.logicalName}</entity></entities></importexportxml>`
        });
    
        return {
          content: [
            {
              type: "text",
              text: `Successfully updated table '${params.logicalName}' and published changes.`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error updating table: ${error instanceof Error ? error.message : 'Unknown error'}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod-based input schema defining parameters for updating table properties including logicalName (required), optional display names, description, and boolean flags for various table features.
    {
      title: "Update Dataverse Table",
      description: "Updates the properties and configuration of an existing Dataverse table. Use this to modify table settings like display names, descriptions, or feature enablement (activities, notes, auditing, etc.). Changes are published automatically.",
      inputSchema: {
        logicalName: z.string().describe("Logical name of the table to update"),
        displayName: z.string().optional().describe("New display name for the table"),
        displayCollectionName: z.string().optional().describe("New display collection name for the table"),
        description: z.string().optional().describe("New description of the table"),
        hasActivities: z.boolean().optional().describe("Whether the table can have activities"),
        hasNotes: z.boolean().optional().describe("Whether the table can have notes"),
        isAuditEnabled: z.boolean().optional().describe("Whether auditing is enabled"),
        isDuplicateDetectionEnabled: z.boolean().optional().describe("Whether duplicate detection is enabled"),
        isValidForQueue: z.boolean().optional().describe("Whether records can be added to queues"),
        isConnectionsEnabled: z.boolean().optional().describe("Whether connections are enabled"),
        isMailMergeEnabled: z.boolean().optional().describe("Whether mail merge is enabled"),
        isDocumentManagementEnabled: z.boolean().optional().describe("Whether document management is enabled")
      }
    },
  • Registers the 'update_dataverse_table' tool on the MCP server within the updateTableTool export function, including schema and handler.
    server.registerTool(
      "update_dataverse_table",
      {
        title: "Update Dataverse Table",
        description: "Updates the properties and configuration of an existing Dataverse table. Use this to modify table settings like display names, descriptions, or feature enablement (activities, notes, auditing, etc.). Changes are published automatically.",
        inputSchema: {
          logicalName: z.string().describe("Logical name of the table to update"),
          displayName: z.string().optional().describe("New display name for the table"),
          displayCollectionName: z.string().optional().describe("New display collection name for the table"),
          description: z.string().optional().describe("New description of the table"),
          hasActivities: z.boolean().optional().describe("Whether the table can have activities"),
          hasNotes: z.boolean().optional().describe("Whether the table can have notes"),
          isAuditEnabled: z.boolean().optional().describe("Whether auditing is enabled"),
          isDuplicateDetectionEnabled: z.boolean().optional().describe("Whether duplicate detection is enabled"),
          isValidForQueue: z.boolean().optional().describe("Whether records can be added to queues"),
          isConnectionsEnabled: z.boolean().optional().describe("Whether connections are enabled"),
          isMailMergeEnabled: z.boolean().optional().describe("Whether mail merge is enabled"),
          isDocumentManagementEnabled: z.boolean().optional().describe("Whether document management is enabled")
        }
      },
      async (params) => {
        try {
          // First, retrieve the current entity definition
          const currentEntity = await client.getMetadata<EntityMetadata>(
            `EntityDefinitions(LogicalName='${params.logicalName}')`
          );
    
          // Create the updated entity definition by merging current with new values
          const updatedEntity: any = {
            ...currentEntity,
            "@odata.type": "Microsoft.Dynamics.CRM.EntityMetadata"
          };
    
          // Update only the specified properties
          if (params.displayName) {
            updatedEntity.DisplayName = createLocalizedLabel(params.displayName);
          }
          if (params.displayCollectionName) {
            updatedEntity.DisplayCollectionName = createLocalizedLabel(params.displayCollectionName);
          }
          if (params.description) {
            updatedEntity.Description = createLocalizedLabel(params.description);
          }
          if (params.hasActivities !== undefined) {
            updatedEntity.HasActivities = params.hasActivities;
          }
          if (params.hasNotes !== undefined) {
            updatedEntity.HasNotes = params.hasNotes;
          }
          if (params.isAuditEnabled !== undefined) {
            updatedEntity.IsAuditEnabled = {
              Value: params.isAuditEnabled,
              CanBeChanged: true,
              ManagedPropertyLogicalName: "canmodifyauditsettings"
            };
          }
          if (params.isDuplicateDetectionEnabled !== undefined) {
            updatedEntity.IsDuplicateDetectionEnabled = {
              Value: params.isDuplicateDetectionEnabled,
              CanBeChanged: true,
              ManagedPropertyLogicalName: "canmodifyduplicatedetectionsettings"
            };
          }
          if (params.isValidForQueue !== undefined) {
            updatedEntity.IsValidForQueue = {
              Value: params.isValidForQueue,
              CanBeChanged: true,
              ManagedPropertyLogicalName: "canmodifyqueuesettings"
            };
          }
          if (params.isConnectionsEnabled !== undefined) {
            updatedEntity.IsConnectionsEnabled = {
              Value: params.isConnectionsEnabled,
              CanBeChanged: true,
              ManagedPropertyLogicalName: "canmodifyconnectionsettings"
            };
          }
          if (params.isMailMergeEnabled !== undefined) {
            updatedEntity.IsMailMergeEnabled = {
              Value: params.isMailMergeEnabled,
              CanBeChanged: true,
              ManagedPropertyLogicalName: "canmodifymailmergesettings"
            };
          }
          if (params.isDocumentManagementEnabled !== undefined) {
            updatedEntity.IsDocumentManagementEnabled = params.isDocumentManagementEnabled;
          }
    
          // Use PUT method with MSCRM.MergeLabels header as per Microsoft documentation
          await client.putMetadata(`EntityDefinitions(LogicalName='${params.logicalName}')`, updatedEntity, {
            'MSCRM.MergeLabels': 'true'
          });
    
          // Publish the changes as required by the API
          await client.callAction('PublishXml', {
            ParameterXml: `<importexportxml><entities><entity>${params.logicalName}</entity></entities></importexportxml>`
          });
    
          return {
            content: [
              {
                type: "text",
                text: `Successfully updated table '${params.logicalName}' and published changes.`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error updating table: ${error instanceof Error ? error.message : 'Unknown error'}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • src/index.ts:141-141 (registration)
    Invokes updateTableTool to perform the actual registration of the tool during server initialization.
    updateTableTool(server, dataverseClient);
  • Utility function to create standardized LocalizedLabel objects used in updating DisplayName, DisplayCollectionName, and Description fields.
    function createLocalizedLabel(text: string, languageCode: number = 1033): LocalizedLabel {
      return {
        LocalizedLabels: [
          {
            Label: text,
            LanguageCode: languageCode,
            IsManaged: false,
            MetadataId: "00000000-0000-0000-0000-000000000000"
          }
        ],
        UserLocalizedLabel: {
          Label: text,
          LanguageCode: languageCode,
          IsManaged: false,
          MetadataId: "00000000-0000-0000-0000-000000000000"
        }
      };
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context about automatic publication ('Changes are published automatically'), which is not inferable from the schema alone. However, it lacks details on permissions, error handling, or mutation effects, leaving gaps for a tool with significant update capabilities.

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?

The description is efficiently structured in two sentences: the first states the purpose and scope, the second adds behavioral context. Every phrase earns its place with no redundant or vague language, making it easy to parse and understand quickly.

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 mutation tool with 12 parameters and no annotations or output schema, the description is adequate but incomplete. It covers the core purpose and one behavioral trait (automatic publishing), but lacks details on permissions, side effects, or response format, which are important for safe and effective use.

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 the schema fully documents all 12 parameters. The description adds marginal value by grouping parameters into categories ('display names, descriptions, or feature enablement'), but does not provide additional syntax, constraints, or examples beyond what the schema already specifies.

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?

The description clearly states the verb ('Updates') and resource ('existing Dataverse table'), specifying what properties can be modified ('properties and configuration', 'table settings like display names, descriptions, or feature enablement'). It distinguishes from siblings like 'create_dataverse_table' by focusing on updates to existing tables rather than creation.

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?

The description provides clear context for when to use this tool ('to modify table settings'), but does not explicitly state when not to use it or name specific alternatives. It implies usage for existing tables but lacks explicit exclusions or comparisons with sibling tools like 'update_dataverse_column'.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mwhesse/mcp-dataverse'

If you have feedback or need assistance with the MCP directory API, please join our Discord server