Skip to main content
Glama
rafteles2016

MCP Dynamics CRM Server

by rafteles2016

dynamics_update_web_resource

Update the content of an existing web resource in Microsoft Dynamics CRM by specifying its ID and providing new content, enabling developers to modify CRM components.

Instructions

Atualiza o conteúdo de um web resource existente

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
webResourceIdYesID do web resource
contentYesNovo conteúdo do web resource
descriptionNo

Implementation Reference

  • The handler for the 'dynamics_update_web_resource' tool, which takes a webResourceId, content, and optional description, encodes the content to Base64, and updates the web resource in Dataverse via the DataverseClient.
    server.tool(
      "dynamics_update_web_resource",
      "Atualiza o conteúdo de um web resource existente",
      UpdateWebResourceSchema.shape,
      async (params: z.infer<typeof UpdateWebResourceSchema>) => {
        const encodedContent = Buffer.from(params.content).toString("base64");
        const data: Record<string, unknown> = { content: encodedContent };
        if (params.description) data.description = params.description;
    
        await client.update("webresourceset", params.webResourceId, data);
    
        return {
          content: [
            {
              type: "text" as const,
              text: `Web resource ${params.webResourceId} atualizado com sucesso!`,
            },
          ],
        };
      }
    );
  • The Zod schema (UpdateWebResourceSchema) used to validate inputs for the 'dynamics_update_web_resource' tool.
    export const UpdateWebResourceSchema = z.object({
      webResourceId: z.string().describe("ID do web resource"),
      content: z.string().describe("Novo conteúdo do web resource"),
      description: z.string().optional(),
    });
  • The registration of the 'dynamics_update_web_resource' tool within the registerWebResourceTools function.
    server.tool(
      "dynamics_update_web_resource",
      "Atualiza o conteúdo de um web resource existente",
      UpdateWebResourceSchema.shape,
      async (params: z.infer<typeof UpdateWebResourceSchema>) => {
        const encodedContent = Buffer.from(params.content).toString("base64");
        const data: Record<string, unknown> = { content: encodedContent };
        if (params.description) data.description = params.description;
    
        await client.update("webresourceset", params.webResourceId, data);
    
        return {
          content: [
            {
              type: "text" as const,
              text: `Web resource ${params.webResourceId} atualizado com sucesso!`,
            },
          ],
        };
      }
    );

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