Skip to main content
Glama
rafteles2016

MCP Dynamics CRM Server

by rafteles2016

dynamics_create_column

Add custom fields to Dynamics CRM tables by defining column properties like data type, length, and validation rules for tailored data management.

Instructions

Cria uma nova coluna (campo/atributo) em uma tabela do Dynamics CRM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityLogicalNameYesNome lógico da entidade
schemaNameYesNome do schema do campo (ex: new_MyField)
displayNameYesNome de exibição
attributeTypeYesTipo do atributo
descriptionNo
requiredLevelNoNone
maxLengthNoComprimento máximo (para String/Memo)
minValueNoValor mínimo (para numéricos)
maxValueNoValor máximo (para numéricos)
precisionNoPrecisão decimal
lookupTargetNoEntidade alvo (para Lookup)
optionSetValuesNoValores do OptionSet (para Picklist)
solutionUniqueNameNo

Implementation Reference

  • The handler for the "dynamics_create_column" tool, which constructs the attribute metadata and sends a POST request to the Dataverse API.
    server.tool(
      "dynamics_create_column",
      "Cria uma nova coluna (campo/atributo) em uma tabela do Dynamics CRM",
      CreateColumnSchema.shape,
      async (params: z.infer<typeof CreateColumnSchema>) => {
        const baseMetadata = ATTRIBUTE_TYPE_METADATA[params.attributeType] || {};
        const attrData: Record<string, unknown> = {
          ...baseMetadata,
          SchemaName: params.schemaName,
          DisplayName: {
            "@odata.type": "Microsoft.Dynamics.CRM.Label",
            LocalizedLabels: [{ "@odata.type": "Microsoft.Dynamics.CRM.LocalizedLabel", Label: params.displayName, LanguageCode: 1046 }],
          },
          Description: {
            "@odata.type": "Microsoft.Dynamics.CRM.Label",
            LocalizedLabels: [{ "@odata.type": "Microsoft.Dynamics.CRM.LocalizedLabel", Label: params.description || "", LanguageCode: 1046 }],
          },
          RequiredLevel: { Value: params.requiredLevel },
        };
    
        if (params.maxLength !== undefined) attrData.MaxLength = params.maxLength;
        if (params.minValue !== undefined) attrData.MinValue = params.minValue;
        if (params.maxValue !== undefined) attrData.MaxValue = params.maxValue;
        if (params.precision !== undefined) attrData.Precision = params.precision;
    
        if (params.attributeType === "Lookup" && params.lookupTarget) {
          attrData.Targets = [params.lookupTarget];
        }
    
        if (params.attributeType === "Picklist" && params.optionSetValues) {
          attrData.OptionSet = {
            IsGlobal: false,
            OptionSetType: "Picklist",
            Options: params.optionSetValues.map((opt) => ({
              Value: opt.value,
              Label: {
                LocalizedLabels: [{ Label: opt.label, LanguageCode: 1046 }],
              },
            })),
          };
        }
    
        let endpoint = `EntityDefinitions(LogicalName='${params.entityLogicalName}')/Attributes`;
        if (params.solutionUniqueName) {
          endpoint += `?SolutionUniqueName='${params.solutionUniqueName}'`;
        }
    
        const result = await client.post<{ MetadataId: string }>(endpoint, attrData);
    
        return {
          content: [
            {
              type: "text" as const,
              text: `Coluna criada com sucesso!\nMetadataId: ${result.MetadataId}\nSchema: ${params.schemaName}\nTipo: ${params.attributeType}\nEntidade: ${params.entityLogicalName}`,
            },
          ],
        };
      }
    );
  • The input schema definition for the "dynamics_create_column" tool.
    export const CreateColumnSchema = z.object({
      entityLogicalName: z.string().describe("Nome lógico da entidade"),
      schemaName: z.string().describe("Nome do schema do campo (ex: new_MyField)"),
      displayName: z.string().describe("Nome de exibição"),
      attributeType: AttributeTypeEnum,
      description: z.string().optional(),
      requiredLevel: z.enum(["None", "SystemRequired", "ApplicationRequired"]).default("None"),
      maxLength: z.number().optional().describe("Comprimento máximo (para String/Memo)"),
      minValue: z.number().optional().describe("Valor mínimo (para numéricos)"),
      maxValue: z.number().optional().describe("Valor máximo (para numéricos)"),
      precision: z.number().optional().describe("Precisão decimal"),
      lookupTarget: z.string().optional().describe("Entidade alvo (para Lookup)"),
      optionSetValues: z.array(z.object({
        label: z.string(),
        value: z.number(),
      })).optional().describe("Valores do OptionSet (para Picklist)"),
      solutionUniqueName: z.string().optional(),
    });
Behavior2/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. While it indicates this is a creation operation, it doesn't describe what happens after creation (e.g., whether the column is immediately available, if publishing is required), potential side effects, permission requirements, or error conditions. For a mutation tool with 13 parameters, this is insufficient behavioral context.

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?

The description is a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized for a tool with a clear primary function, though it could potentially benefit from additional context in a second sentence.

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

Completeness2/5

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

For a complex mutation tool with 13 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what happens after successful creation, what permissions are required, whether publishing is needed, or how to verify the creation. The agent would struggle to use this tool effectively without additional context.

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?

The schema description coverage is 77%, which is relatively high, establishing a baseline of 3. The description doesn't add any parameter-specific information beyond what's already in the schema descriptions. It doesn't explain relationships between parameters (e.g., that 'maxLength' only applies to String/Memo types) or provide examples of valid parameter combinations.

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

Purpose4/5

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

The description clearly states the action ('Cria uma nova coluna') and target resource ('em uma tabela do Dynamics CRM'), providing specific verb+resource information. However, it doesn't differentiate this tool from its sibling 'dynamics_update_column' or explain when to use create versus update operations.

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?

The description provides no guidance on when to use this tool versus alternatives like 'dynamics_update_column' or 'dynamics_list_columns'. There's no mention of prerequisites, permissions required, or typical use cases for creating columns versus using existing ones.

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/rafteles2016/mcpDynamics'

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