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}`, }, ], }; } } );

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