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
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 mentions the return value ('username') but does not disclose behavioral traits such as error conditions, performance, or system dependencies. This leaves gaps in understanding how the tool behaves beyond its basic function.

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 that directly states the tool's purpose without any unnecessary words. It is front-loaded and appropriately sized, making it easy to parse and understand quickly.

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 simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. It explains what the tool returns but lacks details on output format or potential issues, which could be helpful for an agent. However, for such a simple tool, it meets basic needs.

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, and the schema description coverage is 100%, so no parameter information is needed. The description does not add parameter semantics, but this is acceptable given the lack of parameters, warranting a baseline score of 4.

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 with a specific verb ('Returns') and resource ('username of the current system user'), making it easy to understand what it does. However, since there are no sibling tools, it cannot differentiate from alternatives, which prevents a perfect 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 Guidelines3/5

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

The description implies usage by stating it returns 'my identity,' suggesting it's for identifying the current user, but it lacks explicit guidance on when to use it versus alternatives or any exclusions. With no sibling tools, this is adequate but not comprehensive.

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

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