Skip to main content
Glama

fetch-accounts

Retrieve account data from Microsoft Dynamics 365 using the Model Context Protocol server, enabling efficient management and access to account information through natural language interactions.

Instructions

Fetch accounts from Dynamics 365

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'fetch-accounts' tool. It invokes d365.getAccounts(), formats the response as JSON, and returns it, handling errors appropriately.
    async () => { try { const response = await d365.getAccounts(); const accounts = JSON.stringify(response.value, null, 2); return { content: [ { type: "text", text: accounts, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error: ${ error instanceof Error ? error.message : "Unknown error" }, please check your credentials and try again.`, }, ], isError: true, }; } } );
  • src/tools.ts:39-69 (registration)
    Registration of the 'fetch-accounts' tool in the registerTools function using server.tool() with name, description, empty schema, and inline handler.
    server.tool( "fetch-accounts", "Fetch accounts from Dynamics 365", {}, async () => { try { const response = await d365.getAccounts(); const accounts = JSON.stringify(response.value, null, 2); return { content: [ { type: "text", text: accounts, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error: ${ error instanceof Error ? error.message : "Unknown error" }, please check your credentials and try again.`, }, ], isError: true, }; } } );
  • Helper method getAccounts() in Dynamics365 class that performs the API request to retrieve accounts from Dynamics 365.
    public async getAccounts(): Promise<any> { return this.makeApiRequest("api/data/v9.2/accounts", "GET"); }

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