Skip to main content
Glama
srikanth-paladugula

Dynamics 365 MCP Server

create-account

Create new accounts in Dynamics 365 to manage customer data and relationships within the CRM system.

Instructions

Create a new account in Dynamics 365

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountDataYes

Implementation Reference

  • Full registration of the 'create-account' MCP tool, including description, minimal input schema allowing any accountData object, and the handler function that calls the Dynamics365 helper and formats the result as text content.
    // Register the "create-account" tool
    server.tool(
      "create-account",
      "Create a new account in Dynamics 365",
      { accountData: z.object({}) },
      async (params) => {
        try {
          const { accountData } = params;
          const response = await d365.createAccount(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,
          };
        }
      }
    );
  • Helper method in the Dynamics365 class that validates input and makes a POST API request to create a new account entity in Dynamics 365 Web API.
    public async createAccount(accountData: any): Promise<any> {
      if (!accountData) {
        throw new Error("Account data is required to create an account.");
      }
    
      const endpoint = "api/data/v9.2/accounts";
      return this.makeApiRequest(endpoint, "POST", accountData);
    }

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-dyamics365-server'

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