Skip to main content
Glama

get_current_user

Retrieve the authenticated user's Microsoft Teams profile, including display name, email, job title, and department, for identity verification and personalization.

Instructions

Get the current authenticated user's profile information including display name, email, job title, and department.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the get_current_user tool. It retrieves the current authenticated user's profile from the Microsoft Graph API using the /me endpoint, maps it to a UserSummary, stringifies to JSON, and returns as text content. Includes error handling to return an error message if the request fails.
    async () => {
      try {
        const client = await graphService.getClient();
        const user = (await client.api("/me").get()) as User;
    
        const userSummary: UserSummary = {
          displayName: user.displayName,
          userPrincipalName: user.userPrincipalName,
          mail: user.mail,
          id: user.id,
          jobTitle: user.jobTitle,
          department: user.department,
        };
    
        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}`,
            },
          ],
        };
      }
    }
  • Empty schema indicating the get_current_user tool requires no input parameters.
    {},
  • Registers the get_current_user tool using server.tool(), providing the tool name, description, schema, and inline handler function.
    server.tool(
      "get_current_user",
      "Get the current authenticated user's profile information including display name, email, job title, and department.",
      {},
      async () => {
        try {
          const client = await graphService.getClient();
          const user = (await client.api("/me").get()) as User;
    
          const userSummary: UserSummary = {
            displayName: user.displayName,
            userPrincipalName: user.userPrincipalName,
            mail: user.mail,
            id: user.id,
            jobTitle: user.jobTitle,
            department: user.department,
          };
    
          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}`,
              },
            ],
          };
        }
      }
    );
Behavior3/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 this is a read operation ('Get') and specifies what information is returned, but doesn't disclose behavioral aspects like authentication requirements, rate limits, error conditions, or data freshness. The description adds value by listing returned fields but lacks operational context.

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, well-structured sentence that efficiently communicates the tool's purpose and key returned fields without any redundant information. It's front-loaded with the main action and resource.

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 no annotations and no output schema, the description provides basic purpose and output field examples but lacks details on authentication, errors, or full return structure. For a read-only tool with 0 parameters, this is adequate but leaves gaps in behavioral context that could help an agent use it correctly.

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 tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, and it focuses on the tool's purpose and output instead.

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

Purpose5/5

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

The description clearly states the specific verb 'Get' and resource 'current authenticated user's profile information', with explicit examples of included fields (display name, email, job title, department). It distinguishes from sibling tools like 'get_user' by specifying 'current authenticated' rather than a general user lookup.

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

Usage Guidelines4/5

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

The description implies usage context (when you need profile info for the authenticated user) but doesn't explicitly state when not to use it or name alternatives. For instance, it doesn't contrast with 'get_user' for looking up other users or 'auth_status' for authentication state.

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