Skip to main content
Glama
rafteles2016

MCP Dynamics CRM Server

by rafteles2016

dynamics_generate_web_resource_code

Generate template code for Dynamics CRM web resources (JS/HTML/CSS) with built-in form helpers to streamline custom interface development.

Instructions

Gera código template para web resources (JS/HTML/CSS) com helpers do Dynamics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesNome do web resource
typeYesTipo do código
entityLogicalNameNoEntidade associada
formTypeNoTipo de formulário
descriptionNoDescrição do que o código deve fazer
includeFormHelpersNoIncluir helpers para formulário Dynamics

Implementation Reference

  • Handler function for "dynamics_generate_web_resource_code" which generates template code for JavaScript, HTML, or CSS web resources based on the provided parameters.
    server.tool(
      "dynamics_generate_web_resource_code",
      "Gera código template para web resources (JS/HTML/CSS) com helpers do Dynamics",
      GenerateWebResourceCodeSchema.shape,
      async (params: z.infer<typeof GenerateWebResourceCodeSchema>) => {
        let code = "";
    
        if (params.type === "JavaScript") {
          code = params.includeFormHelpers
            ? WEB_RESOURCE_TEMPLATES.javascript.form
            : WEB_RESOURCE_TEMPLATES.javascript.library;
        } else if (params.type === "HTML") {
          code = WEB_RESOURCE_TEMPLATES.html;
        } else if (params.type === "CSS") {
          code = WEB_RESOURCE_TEMPLATES.css;
        }
    
        code = code
          .replace(/{{NAME}}/g, params.name)
          .replace(/{{ENTITY_LOGICAL_NAME}}/g, params.entityLogicalName || "entity")
          .replace(/{{DESCRIPTION}}/g, params.description || "");
    
        return {
          content: [
            {
              type: "text" as const,
              text: `Código gerado para **${params.name}** (${params.type}):\n\n\`\`\`${params.type.toLowerCase()}\n${code}\n\`\`\``,
            },
          ],
        };
      }
    );
  • Zod schema validation definition for "dynamics_generate_web_resource_code".
    export const GenerateWebResourceCodeSchema = z.object({
      name: z.string().describe("Nome do web resource"),
      type: z.enum(["JavaScript", "HTML", "CSS"]).describe("Tipo do código"),
      entityLogicalName: z.string().optional().describe("Entidade associada"),
      formType: z.enum(["main", "quickcreate", "quickview"]).optional().describe("Tipo de formulário"),
      description: z.string().optional().describe("Descrição do que o código deve fazer"),
      includeFormHelpers: z.boolean().default(true).describe("Incluir helpers para formulário Dynamics"),
    });
  • Registration of the "dynamics_generate_web_resource_code" tool within the registerWebResourceTools function.
    server.tool(
      "dynamics_generate_web_resource_code",
      "Gera código template para web resources (JS/HTML/CSS) com helpers do Dynamics",
      GenerateWebResourceCodeSchema.shape,
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 mentions the tool generates template code with Dynamics helpers, but doesn't specify whether this creates actual resources, is read-only, requires specific permissions, or has any side effects. For a code generation tool with potential downstream implications, 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 in Portuguese that clearly states the tool's core function. It's appropriately sized for its purpose with zero wasted words or redundant information. The structure is front-loaded with the essential action and context.

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 code generation tool with 6 parameters and no annotations or output schema, the description is incomplete. It doesn't explain what the generated output looks like, how templates are structured, whether they're immediately usable, or how they integrate with the Dynamics ecosystem. The lack of behavioral context and output information creates significant gaps for an agent trying to use this tool effectively.

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 already documents all 6 parameters thoroughly. The description mentions generating code for web resources with Dynamics helpers, which aligns with the 'includeFormHelpers' parameter and context, but adds no specific parameter semantics beyond what the schema provides. This meets the baseline for high schema coverage.

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 tool's purpose: 'Gera código template para web resources (JS/HTML/CSS) com helpers do Dynamics' (Generates template code for web resources with Dynamics helpers). It specifies the verb ('gera' - generates), resource ('código template' - template code), and technology context (Dynamics helpers). However, it doesn't explicitly differentiate from sibling tools like 'dynamics_create_web_resource' or 'dynamics_generate_plugin_code', which would be needed for a perfect score.

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. There are multiple sibling tools related to web resources (create_web_resource, delete_web_resource, update_web_resource, get_web_resource_content, publish_web_resources), but the description doesn't explain when template generation is appropriate versus direct creation or management. No prerequisites, constraints, or alternatives are mentioned.

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