Skip to main content
Glama

create-account

Use this tool to generate a new account in Dynamics 365 via the MCP server, enabling efficient account management through structured data input.

Instructions

Create a new account in Dynamics 365

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountDataYes

Implementation Reference

  • The core handler function for the "create-account" tool. It destructures accountData from input params, calls the Dynamics365.createAccount helper, and returns the formatted JSON response or an error message.
    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, }; }
  • Zod-based input schema for the tool, defining a required 'accountData' parameter as an empty object schema (allows any object structure).
    { accountData: z.object({}) },
  • src/tools.ts:104-133 (registration)
    Registration of the "create-account" tool using McpServer.tool(), specifying name, description, input schema, and inline handler function within registerTools.
    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 delegates to makeApiRequest for POSTing account data to the Dynamics 365 Web API endpoint /api/data/v9.2/accounts.
    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); }

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