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
| Name | Required | Description | Default |
|---|---|---|---|
| webResourceId | Yes | ID do web resource | |
| content | Yes | Novo conteúdo do web resource | |
| description | No |
Implementation Reference
- src/tools/webresources/index.ts:110-130 (handler)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(), }); - src/tools/webresources/index.ts:110-130 (registration)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!`, }, ], }; } );