Skip to main content
Glama
rafteles2016

MCP Dynamics CRM Server

by rafteles2016

dynamics_create_table

Create a new table (entity) in Dynamics CRM by specifying schema name, display names, and ownership type to organize custom data structures.

Instructions

Cria uma nova tabela (entidade) no Dynamics CRM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaNameYesNome do schema (ex: new_MyTable)
displayNameYesNome de exibição
displayCollectionNameYesNome de exibição plural
descriptionNo
primaryAttributeSchemaNameNoNome do atributo primárionew_name
primaryAttributeDisplayNameNoDisplay name do atributo primárioNome
primaryAttributeMaxLengthNo
ownershipTypeNoUserOwned
isActivityNo
solutionUniqueNameNo

Implementation Reference

  • The handler for dynamics_create_table which constructs the entity definition and calls the Dataverse client.
    server.tool(
      "dynamics_create_table",
      "Cria uma nova tabela (entidade) no Dynamics CRM",
      CreateTableSchema.shape,
      async (params: z.infer<typeof CreateTableSchema>) => {
        const entityData: Record<string, unknown> = {
          SchemaName: params.schemaName,
          DisplayName: {
            "@odata.type": "Microsoft.Dynamics.CRM.Label",
            LocalizedLabels: [{ "@odata.type": "Microsoft.Dynamics.CRM.LocalizedLabel", Label: params.displayName, LanguageCode: 1046 }],
          },
          DisplayCollectionName: {
            "@odata.type": "Microsoft.Dynamics.CRM.Label",
            LocalizedLabels: [{ "@odata.type": "Microsoft.Dynamics.CRM.LocalizedLabel", Label: params.displayCollectionName, LanguageCode: 1046 }],
          },
          Description: {
            "@odata.type": "Microsoft.Dynamics.CRM.Label",
            LocalizedLabels: [{ "@odata.type": "Microsoft.Dynamics.CRM.LocalizedLabel", Label: params.description || "", LanguageCode: 1046 }],
          },
          OwnershipType: params.ownershipType,
          IsActivity: params.isActivity,
          HasNotes: true,
          HasActivities: true,
          PrimaryNameAttribute: params.primaryAttributeSchemaName.toLowerCase(),
          Attributes: [
            {
              "@odata.type": "Microsoft.Dynamics.CRM.StringAttributeMetadata",
              SchemaName: params.primaryAttributeSchemaName,
              DisplayName: {
                "@odata.type": "Microsoft.Dynamics.CRM.Label",
                LocalizedLabels: [{ "@odata.type": "Microsoft.Dynamics.CRM.LocalizedLabel", Label: params.primaryAttributeDisplayName, LanguageCode: 1046 }],
              },
              RequiredLevel: { Value: "ApplicationRequired" },
              MaxLength: params.primaryAttributeMaxLength,
              FormatName: { Value: "Text" },
              IsPrimaryName: true,
            },
          ],
        };
    
        let endpoint = "EntityDefinitions";
        if (params.solutionUniqueName) {
          endpoint += `?SolutionUniqueName='${params.solutionUniqueName}'`;
        }
    
        const result = await client.post<{ MetadataId: string }>(endpoint, entityData);
    
        return {
          content: [
            {
              type: "text" as const,
              text: `Tabela criada com sucesso!\nMetadataId: ${result.MetadataId}\nSchemaName: ${params.schemaName}\nDisplay: ${params.displayName}`,
            },
          ],
        };
      }
    );
  • Zod schema defining the input parameters for dynamics_create_table.
    export const CreateTableSchema = z.object({
      schemaName: z.string().describe("Nome do schema (ex: new_MyTable)"),
      displayName: z.string().describe("Nome de exibição"),
      displayCollectionName: z.string().describe("Nome de exibição plural"),
      description: z.string().optional(),
      primaryAttributeSchemaName: z.string().default("new_name").describe("Nome do atributo primário"),
      primaryAttributeDisplayName: z.string().default("Nome").describe("Display name do atributo primário"),
      primaryAttributeMaxLength: z.number().default(100),
      ownershipType: z.enum(["UserOwned", "OrganizationOwned"]).default("UserOwned"),
      isActivity: z.boolean().default(false),
      solutionUniqueName: z.string().optional(),
    });
  • The registration function where dynamics_create_table is defined within the server tool registration.
    export function registerSchemaTools(
      server: { tool: Function },
      client: DataverseClient
    ) {
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this creates a new table/entity but provides no information about permissions required, whether this is a destructive operation, what happens on success/failure, or any system constraints. For a creation tool with significant 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.

Conciseness5/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 this level of complexity and gets straight to the point.

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 tool that creates a new table/entity in Dynamics CRM with 10 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what a successful creation returns, what validation occurs, or how this tool relates to the broader Dynamics CRM customization workflow. The single sentence leaves too many contextual gaps.

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 description provides no parameter information beyond what's in the schema. With 50% schema description coverage (5 of 10 parameters have descriptions), the description doesn't compensate for the coverage gap. However, since the schema covers half the parameters adequately, the baseline of 3 is appropriate - the description adds no value but doesn't make things worse.

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' - creates) and resource ('uma nova tabela (entidade) no Dynamics CRM'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'dynamics_create_solution' or 'dynamics_create_column', but the specificity of creating a table/entity is clear.

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?

No guidance is provided about when to use this tool versus alternatives. With many sibling tools in the Dynamics CRM domain (like dynamics_create_solution, dynamics_create_column, dynamics_create_relationship), the description offers no context about prerequisites, sequencing, or when this specific table creation tool is appropriate.

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