Skip to main content
Glama

fetch-accounts

Retrieve account data from Dynamics 365 to access customer information and business details for analysis and management.

Instructions

Fetch accounts from Dynamics 365

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The inline async handler function for the "fetch-accounts" tool. It calls d365.getAccounts() to fetch accounts, stringifies the response.value as JSON, and returns it as text content. Includes try-catch error handling returning an error message.
    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)
    The server.tool() call that registers the "fetch-accounts" tool with the MCP server, including name, description, empty input schema ({}), and the handler function.
    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, }; } } );
  • The getAccounts() method in the Dynamics365 class, which performs a GET request to the /api/data/v9.2/accounts endpoint using the private makeApiRequest method, handling authentication.
    public async getAccounts(): Promise<any> { return this.makeApiRequest("api/data/v9.2/accounts", "GET"); }

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