Skip to main content
Glama
srikanth-paladugula

Dynamics 365 MCP Server

get-user-info

Retrieve user information from Dynamics 365 to access contact details, roles, and permissions for system management and support tasks.

Instructions

Get user info from Dynamics 365

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the get-user-info tool: calls makeWhoAmIRequest on Dynamics365 instance and returns formatted user info or error.
      async () => {
        try {
          const response = await d365.makeWhoAmIRequest();
          return {
            content: [
              {
                type: "text",
                text: `Hi ${response.FullName}, your user ID is ${response.UserId} and your business unit ID is ${response.BusinessUnitId}`,
              },
            ],
          };
        } 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:7-36 (registration)
    Registers the get-user-info tool on the MCP server with no input schema and inline handler.
    server.tool(
      "get-user-info",
      "Get user info from Dynamics 365",
      {},
      async () => {
        try {
          const response = await d365.makeWhoAmIRequest();
          return {
            content: [
              {
                type: "text",
                text: `Hi ${response.FullName}, your user ID is ${response.UserId} and your business unit ID is ${response.BusinessUnitId}`,
              },
            ],
          };
        } 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 in Dynamics365 class that makes WhoAmI API request to fetch current user info, used by the tool handler.
    public async makeWhoAmIRequest(): Promise<{
      BusinessUnitId: string;
      UserId: string;
      OrganizationId: string;
      UserName?: string;
      FullName?: string;
    }> {
      const data = await this.makeApiRequest("api/data/v9.2/WhoAmI", "GET");
    
      // If we want to get more details about the user, we can make an additional request
      if (data && data.UserId) {
        const userDetails = await this.makeApiRequest(
          `api/data/v9.2/systemusers(${data.UserId})`,
          "GET",
          undefined,
          { Prefer: 'odata.include-annotations="*"' }
        );
        data.UserName = userDetails.domainname;
        data.FullName = userDetails.fullname;
      }
    
      return data;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states a read operation ('Get'), implying it's likely safe, but doesn't disclose behavioral traits such as authentication requirements, rate limits, error conditions, or what happens if no user is found. This leaves significant gaps in understanding how the tool behaves.

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

Conciseness4/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized for a simple tool, though it could be slightly more informative without losing conciseness.

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?

Given no annotations, no output schema, and a simple but vague purpose, the description is incomplete. It doesn't explain what 'user info' includes, how results are returned, or any constraints, making it inadequate for an agent to use effectively without additional context.

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 no parameter documentation is needed. The description doesn't add param details, which is appropriate here, but it could hint at implicit parameters (e.g., user ID context), though not required. Baseline is 4 for zero parameters.

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

Purpose3/5

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

The description states the action ('Get') and resource ('user info from Dynamics 365'), which provides a basic understanding of purpose. However, it's vague about what specific user information is retrieved and doesn't differentiate from sibling tools like 'fetch-accounts' or 'create-account', leaving ambiguity about scope and distinction.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context (e.g., when user info is needed over account data), or exclusions, leaving the agent without usage direction beyond the basic purpose.

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