Skip to main content
Glama
srikanth-paladugula

Dynamics 365 MCP Server

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");
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'fetch' which implies a read operation, but doesn't specify whether this requires authentication, has rate limits, returns paginated results, or what format the data comes in. This leaves significant gaps for a tool interacting with an external system like Dynamics 365.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states exactly what the tool does with zero wasted words. It's appropriately sized for a simple tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that fetches data from an external system like Dynamics 365 with no annotations and no output schema, the description is incomplete. It doesn't explain what kind of accounts are fetched, whether there are filters or sorting options, what the return format looks like, or any error conditions. The agent would need to guess these important details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so the schema already fully documents the absence of parameters. The description appropriately doesn't add parameter information beyond what's in the schema, maintaining a baseline score of 4 for tools with no parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Fetch accounts from Dynamics 365' clearly states the action (fetch) and resource (accounts from Dynamics 365), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'get-associated-opportunities' which might also fetch account-related data, so it misses the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'create-account' or 'update-account'. It doesn't mention any context, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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