Skip to main content
Glama

whoami

Identify the current system user by returning their username. Use this tool to verify user identity quickly and directly.

Instructions

Returns the username of the current system user as my identity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • main.py:9-18 (handler)
    The handler function for the 'whoami' MCP tool. It retrieves the current system username using getpass.getuser() and returns it as a string, with error handling that returns an error dictionary.
    def whoami() -> str: """Returns the username of the current system user as my identity.""" try: # Get the current system username using getpass.getuser() username = getpass.getuser() # Return a simple dictionary with the username return username except Exception as e: # Handle any unexpected errors (e.g., environment issues) return {"error": f"Failed to fetch username: {str(e)}"}
  • main.py:8-8 (registration)
    Registers the 'whoami' function as an MCP tool using the @mcp.tool() decorator from FastMCP.
    @mcp.tool()
  • main.py:9-10 (schema)
    Schema inferred from function signature (no inputs, str output) and docstring describing the tool's purpose and return value.
    def whoami() -> str: """Returns the username of the current system user as my identity."""
  • main.py:2-2 (helper)
    Imports getpass module, used by the whoami handler to fetch the current username.
    import getpass

Other Tools

Related 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/kukapay/whoami-mcp'

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