Skip to main content
Glama

get_user

Retrieve detailed user profile information from Microsoft Teams by providing a user ID or email address. Returns name, email, job title, and department data.

Instructions

Get detailed information about a specific user by their ID or email address. Returns profile information including name, email, job title, and department.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesUser ID or email address

Implementation Reference

  • Handler for the 'get_user' MCP tool: fetches user profile from Microsoft Graph API using userId (supports ID or email) and returns a UserSummary JSON or error.
    async ({ userId }) => {
      try {
        const client = await graphService.getClient();
        const user = (await client.api(`/users/${userId}`).get()) as User;
    
        const userSummary: UserSummary = {
          displayName: user.displayName,
          userPrincipalName: user.userPrincipalName,
          mail: user.mail,
          id: user.id,
          jobTitle: user.jobTitle,
          department: user.department,
          officeLocation: user.officeLocation,
        };
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(userSummary, null, 2),
            },
          ],
        };
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
        return {
          content: [
            {
              type: "text",
              text: `❌ Error: ${errorMessage}`,
            },
          ],
        };
      }
    }
  • Input schema for 'get_user' tool: requires 'userId' string parameter.
    {
      userId: z.string().describe("User ID or email address"),
    },
  • Registration of the 'get_user' tool via server.tool() within registerUsersTools, including description, Zod schema, and inline handler.
    server.tool(
      "get_user",
      "Get detailed information about a specific user by their ID or email address. Returns profile information including name, email, job title, and department.",
      {
        userId: z.string().describe("User ID or email address"),
      },
      async ({ userId }) => {
        try {
          const client = await graphService.getClient();
          const user = (await client.api(`/users/${userId}`).get()) as User;
    
          const userSummary: UserSummary = {
            displayName: user.displayName,
            userPrincipalName: user.userPrincipalName,
            mail: user.mail,
            id: user.id,
            jobTitle: user.jobTitle,
            department: user.department,
            officeLocation: user.officeLocation,
          };
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(userSummary, null, 2),
              },
            ],
          };
        } catch (error: unknown) {
          const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
          return {
            content: [
              {
                type: "text",
                text: `❌ Error: ${errorMessage}`,
              },
            ],
          };
        }
      }
    );
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. It states this is a read operation ('Get') and describes the return data, but lacks details on permissions, error handling, rate limits, or whether it's idempotent. For a tool with zero annotation coverage, this is insufficient behavioral disclosure.

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 concise and front-loaded, with two sentences that efficiently convey the tool's purpose and return data. However, it could be slightly more structured by separating usage guidelines or behavioral details, but it avoids unnecessary verbosity.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and return values, but lacks completeness in usage guidelines and behavioral transparency, which are needed for effective agent operation.

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

Parameters3/5

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

Schema description coverage is 100%, with the parameter 'userId' documented as 'User ID or email address.' The description adds no additional parameter semantics beyond what the schema provides, such as format examples or validation rules, so it meets the baseline score of 3.

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 clearly states the tool's purpose: 'Get detailed information about a specific user by their ID or email address.' It specifies the verb ('Get'), resource ('user'), and scope ('detailed information'), but does not explicitly differentiate it from sibling tools like 'get_current_user' or 'search_users', which prevents a score of 5.

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 'get_current_user' (for the current user) or 'search_users' (for broader queries). It mentions the input method (ID or email) but offers no context on appropriate use cases or exclusions.

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/floriscornel/teams-mcp'

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