Skip to main content
Glama

getAuthenticatedUser

Retrieve current user context including ID, username, team, and roles for personalized API requests.

Instructions

Gets information about the authenticated user. Use this to get current user context (user.id, username, teamId, roles) for 'my ...' requests.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The GetAuthenticatedUserTool class is the handler for 'getAuthenticatedUser'. It extends ToolHandler and implements run_tool() which calls POSTMAN API GET /me and returns the result as JSON.
    class GetAuthenticatedUserTool(ToolHandler):
        """Get authenticated user information"""
        
        def __init__(self):
            super().__init__("getAuthenticatedUser")
        
        def get_tool_description(self) -> Tool:
            return Tool(
                name=self.name,
                description="Gets information about the authenticated user. Use this to get current user context (user.id, username, teamId, roles) for 'my ...' requests.",
                inputSchema={
                    "type": "object",
                    "properties": {},
                },
            )
        
        async def run_tool(self, args: dict) -> list[TextContent]:
            result = await postman_api_call("GET", "/me")
            return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • The inputSchema for 'getAuthenticatedUser' is defined in get_tool_description(). It requires no parameters (empty properties object), as it simply returns info about the authenticated user.
    def get_tool_description(self) -> Tool:
        return Tool(
            name=self.name,
            description="Gets information about the authenticated user. Use this to get current user context (user.id, username, teamId, roles) for 'my ...' requests.",
            inputSchema={
                "type": "object",
                "properties": {},
            },
        )
  • The tool is registered in the register_all_tools() function by instantiating GetAuthenticatedUserTool() and including it in the returned list of handlers.
    def register_all_tools() -> list[ToolHandler]:
        """Register all Postman tool handlers"""
        return [
            # User Info
            GetAuthenticatedUserTool(),
  • The postman_api_call helper function is called by the handler to make the GET /me API request to Postman API.
    async def postman_api_call(
        method: str,
        endpoint: str,
        body: dict | None = None,
        params: dict | None = None,
        headers: dict | None = None
    ) -> dict:
        """Make an API call to Postman API"""
        if not POSTMAN_API_KEY:
            raise RuntimeError("POSTMAN_API_KEY environment variable is not set")
        
        url = f"{POSTMAN_BASE_URL}{endpoint}"
        
        # Prepare headers
        request_headers = {
            "X-Api-Key": POSTMAN_API_KEY,
            "Content-Type": "application/json",
        }
        if headers:
            request_headers.update(headers)
        
        async with httpx.AsyncClient(timeout=30.0) as client:
            try:
                response = await client.request(
                    method=method,
                    url=url,
                    json=body,
                    params=params,
                    headers=request_headers
                )
                response.raise_for_status()
                
                if response.status_code == 204:
                    return {"success": True, "message": "Operation completed successfully"}
                
                return response.json() if response.content else {"success": True}
            
            except httpx.HTTPStatusError as e:
                error_detail = e.response.text
                try:
                    error_json = e.response.json()
                    error_detail = json.dumps(error_json, indent=2)
                except:
                    pass
                raise RuntimeError(f"Postman API error ({e.response.status_code}): {error_detail}")
            except Exception as e:
                raise RuntimeError(f"Request failed: {str(e)}")
  • The ToolHandler base class (ABC) that GetAuthenticatedUserTool extends. It requires implementing get_tool_description() and run_tool().
    class ToolHandler(ABC):
        """Base class for all Postman tool handlers"""
        
        def __init__(self, name: str):
            self.name = name
        
        @abstractmethod
        def get_tool_description(self) -> Tool:
            """Return the MCP Tool description for this handler"""
            pass
        
        @abstractmethod
        async def run_tool(self, arguments: dict) -> list[TextContent | ImageContent | EmbeddedResource]:
            """Execute the tool with the given arguments"""
            pass
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not mention behavioral traits such as read-only nature, authentication requirements, or potential errors. This leaves the agent without critical safety information.

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?

Two concise sentences with no wasted words. The first sentence states the primary purpose, and the second provides usage context, making it efficient for an agent to parse.

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

Completeness4/5

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

Given the simple nature of the tool (no parameters, no output schema), the description adequately covers the primary usage and return fields. However, it omits error conditions or authentication context, which are mildly important for completeness.

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 input schema has zero parameters (100% coverage), so no additional parameter details are needed. The description adds value by listing the returned fields (user.id, username, teamId, roles), which aids in understanding the output.

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 verb 'Gets' and the resource 'information about the authenticated user', distinguishing it from sibling tools that fetch other resources like workspaces or collections.

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 explicitly advises using this tool for 'my ...' requests, providing clear context. It does not explicitly exclude other scenarios, but the guidance is sufficient for an agent.

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/Sourav4670/postman-mcp'

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