Skip to main content
Glama

get-user-info

Retrieve user information from Dynamics 365 to access contact details, roles, and permissions for account management and workflow coordination.

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 the Dynamics365 instance, formats the user information into an MCP response, or returns an error message.
    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)
    Registration of the "get-user-info" tool with the MCP server, including name, description, empty input schema, and inline handler function.
    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 performs the WhoAmI API request to retrieve current user information, including additional user details from systemusers endpoint.
    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 the full burden of behavioral disclosure. It only states the action ('Get user info') without details on permissions needed, rate limits, response format, or whether it's a read-only operation. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 with no wasted words. It is appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary elaboration.

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 and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., auth needs, return values) and does not compensate for the absence of structured data. For a tool with complexity implied by sibling tools, more context is needed.

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 does not add param info, but that's acceptable here. Baseline is 4 for zero parameters, as the schema fully covers the lack of inputs.

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 verb ('Get') and resource ('user info from Dynamics 365'), which provides a basic purpose. However, it lacks specificity about what 'user info' entails (e.g., basic profile, permissions, contact details) and does not distinguish this tool from potential siblings like 'fetch-accounts' or 'create-account', making it somewhat vague.

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 does not mention context, prerequisites, or exclusions, such as whether it retrieves current user info, requires authentication, or differs from sibling tools like 'fetch-accounts' for account data. This leaves the agent without usage direction.

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-dynamics365-server'

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