Skip to main content
Glama

update-account

Modify an existing account in Dynamics 365 by updating its account data using the specified account ID.

Instructions

Update an existing account in Dynamics 365

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountDataYes
accountIdYes

Implementation Reference

  • The handler function for the 'update-account' tool. It processes the input parameters, invokes the Dynamics365.updateAccount method, and returns a formatted response or error message.
    async (params) => { try { const { accountId, accountData } = params; const response = await d365.updateAccount(accountId, accountData); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error: ${ error instanceof Error ? error.message : "Unknown error" }, please check your input and try again.`, }, ], isError: true, }; } }
  • Zod schema defining the input parameters for the 'update-account' tool: accountId (string) and accountData (object).
    { accountId: z.string(), accountData: z.object({}), },
  • src/tools.ts:136-170 (registration)
    The registration of the 'update-account' tool on the MCP server using server.tool(), including description, schema, and inline handler.
    // Register the "update-account" tool server.tool( "update-account", "Update an existing account in Dynamics 365", { accountId: z.string(), accountData: z.object({}), }, async (params) => { try { const { accountId, accountData } = params; const response = await d365.updateAccount(accountId, accountData); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error: ${ error instanceof Error ? error.message : "Unknown error" }, please check your input and try again.`, }, ], isError: true, }; } } );
  • The core helper method in the Dynamics365 class that handles the actual API PATCH request to update the account in Dynamics 365.
    public async updateAccount( accountId: string, accountData: any ): Promise<any> { if (!accountId) { throw new Error("Account ID is required to update an account."); } if (!accountData) { throw new Error("Account data is required to update an account."); } const endpoint = `api/data/v9.2/accounts(${accountId})`; return this.makeApiRequest(endpoint, "PATCH", accountData); }

Other Tools

Related 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/srikanth-paladugula/mcp-dynamics365-server'

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