Skip to main content
Glama

getAuthenticatedUser

Read-onlyIdempotent

Retrieves the authenticated user's ID, username, team, and roles. Use this to resolve the current user context for queries about personal resources.

Instructions

Gets information about the authenticated user.

  • This endpoint provides “current user” context (`user.id`, `username`, `teamId`, roles).

  • When a user asks for “my …” (e.g., “my workspaces, my information, etc.”), call this first to resolve the user ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the tool logic. It calls the `/me` endpoint via the PostmanAPIClient to fetch information about the authenticated user.
    export async function handler(
      args: z.infer<typeof parameters>,
      extra: { client: PostmanAPIClient; headers?: IsomorphicHeaders; serverContext?: ServerContext }
    ): Promise<CallToolResult> {
      try {
        const endpoint = `/me`;
        const query = new URLSearchParams();
        const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
        const options: any = {
          headers: extra.headers,
        };
        const result = await extra.client.get(url, options);
        return {
          content: [
            {
              type: 'text',
              text: `${typeof result === 'string' ? result : JSON.stringify(result, null, 2)}`,
            },
          ],
        };
      } catch (e: unknown) {
        if (e instanceof McpError) {
          throw e;
        }
        throw asMcpError(e);
      }
    }
  • The method name, description, parameters (empty/input-free Zod schema), and annotations for the getAuthenticatedUser tool.
    export const method = 'getAuthenticatedUser';
    export const description =
      'Gets information about the authenticated user.\n- This endpoint provides “current user” context (\\`user.id\\`, \\`username\\`, \\`teamId\\`, roles).\n- When a user asks for “my …” (e.g., “my workspaces, my information, etc.”), call this first to resolve the user ID.\n';
    export const parameters = z.object({});
  • The tool is registered in three lists: 'full' (line 135), 'minimal' (line 173), and 'code' (line 215) in enabledResources.ts, making it available in all server modes.
    const full = [
      // Collections
      'createCollection',
      'deleteCollection',
      'generateCollection',
      'getCollection',
      'getCollections',
      'patchCollection',
      'putCollection',
      'getCollectionTags',
      'updateCollectionTags',
      'getCollectionUpdatesTasks',
      'syncCollectionWithSpec',
      'syncSpecWithCollection',
      'generateSpecFromCollection',
      'getGeneratedCollectionSpecs',
      'getSpecCollections',
    
      // Collection Forks
      'getCollectionForks',
      'getSourceCollectionStatus',
      'getCollectionsForkedByUser',
      'pullCollectionChanges',
      'createCollectionFork',
      'mergeCollectionFork',
    
      // Collection Folders
      'createCollectionFolder',
      'deleteCollectionFolder',
      'getCollectionFolder',
      'updateCollectionFolder',
      'transferCollectionFolders',
    
      // Collection Requests
      'createCollectionRequest',
      'deleteCollectionRequest',
      'getCollectionRequest',
      'updateCollectionRequest',
      'transferCollectionRequests',
    
      // Collection Responses
      'createCollectionResponse',
      'deleteCollectionResponse',
      'getCollectionResponse',
      'updateCollectionResponse',
      'transferCollectionResponses',
    
      // Collection Runner
      'runCollection',
    
      // Comments
      'createCollectionComment',
      'deleteCollectionComment',
      'getCollectionComments',
      'updateCollectionComment',
      'updateApiCollectionComment',
      'createFolderComment',
      'deleteFolderComment',
      'getFolderComments',
      'updateFolderComment',
      'createRequestComment',
      'deleteRequestComment',
      'getRequestComments',
      'updateRequestComment',
      'createResponseComment',
      'deleteResponseComment',
      'getResponseComments',
      'updateResponseComment',
      'resolveCommentThread',
    
      // Environments
      'createEnvironment',
      'deleteEnvironment',
      'getEnvironment',
      'getEnvironments',
      'patchEnvironment',
      'putEnvironment',
    
      // Mocks
      'createMock',
      'deleteMock',
      'getMock',
      'getMocks',
      'updateMock',
      'publishMock',
      'unpublishMock',
    
      // Monitors
      'createMonitor',
      'deleteMonitor',
      'getMonitor',
      'getMonitors',
      'updateMonitor',
      'runMonitor',
    
      // Specs
      'createSpec',
      'deleteSpec',
      'getSpec',
      'getAllSpecs',
      'getSpecDefinition',
      'updateSpecProperties',
      'createSpecFile',
      'getSpecFile',
      'getSpecFiles',
      'updateSpecFile',
    
      // Workspaces
      'createWorkspace',
      'deleteWorkspace',
      'getWorkspace',
      'getWorkspaces',
      'updateWorkspace',
      'getWorkspaceGlobalVariables',
      'updateWorkspaceGlobalVariables',
      'getWorkspaceTags',
      'updateWorkspaceTags',
    
      // PAN (Private API Network)
      'listPrivateNetworkWorkspaces',
      'listPrivateNetworkAddRequests',
      'removeWorkspaceFromPrivateNetwork',
      'addWorkspaceToPrivateNetwork',
      'respondPrivateNetworkAddRequest',
    
      // // Documentation
      'publishDocumentation',
      'unpublishDocumentation',
    
      // Tasks and Status
      'getAsyncSpecTaskStatus',
      'getStatusOfAnAsyncApiTask',
    
      // User and Tags
      'getAuthenticatedUser',
      'getTaggedEntities',
    
      // Code Generation
      'getCodeGenerationInstructions',
    
      // Transfer
      'transferCollectionFolders',
      'transferCollectionResponses',
      'transferCollectionResponses',
    
      // 'asyncMergePullCollectionFork' skipped
      // 'asyncMergePullCollectionTaskStatus' skipped
    
      // Duplicate Collection
      'duplicateCollection',
      'getDuplicateCollectionTaskStatus',
      'deleteApiCollectionComment',
      'deleteSpecFile',
      'getEnabledTools',
      'searchPostmanElementsInPublicNetwork',
      'searchPostmanElementsInPrivateNetwork',
    
      // Analytics
      'getAnalyticsData',
      'getAnalyticsMetadata',
    ] as const;
    
    const minimal = [
      'createCollection',
      'createEnvironment',
      'createMock',
      'createSpec',
      'createSpecFile',
      'createWorkspace',
      'generateCollection',
      'generateSpecFromCollection',
      'getAllSpecs',
      'getAuthenticatedUser',
      'getCollection',
      'getCollections',
      'getEnvironment',
      'getEnvironments',
      'getGeneratedCollectionSpecs',
      'getMock',
      'getMocks',
      'getSpec',
      'getSpecCollections',
      'getSpecDefinition',
      'getSpecFile',
      'getSpecFiles',
      'getTaggedEntities',
      'getWorkspace',
      'getWorkspaces',
      'publishMock',
      'putCollection',
      'putEnvironment',
      'syncCollectionWithSpec',
      'syncSpecWithCollection',
      'updateMock',
      'updateSpecFile',
      'updateSpecProperties',
      'updateWorkspace',
      'createCollectionRequest',
      'createCollectionResponse',
      'duplicateCollection',
      'getDuplicateCollectionTaskStatus',
      'runCollection',
      'getEnabledTools',
      'updateCollectionRequest',
    ] as const;
    
    const code = [
      'getCodeGenerationInstructions',
      'getWorkspace',
      'getWorkspaces',
      'searchPostmanElementsInPublicNetwork',
      'getCollectionRequest',
      'getCollectionResponse',
      'getCollectionFolder',
      'getAuthenticatedUser',
      'getCollection',
      'getEnvironment',
      'getEnvironments',
      'searchPostmanElementsInPrivateNetwork',
    ] as const;
    
    const excludedFromGeneration = [
      'runCollection',
      'getEnabledTools',
      'getCodeGenerationInstructions',
      'getCollectionMap',
      'getCollection',
      'searchPostmanElementsInPublicNetwork',
      'searchPostmanElementsInPrivateNetwork',
    ] as const;
    
    /**
     * Subtools are tools that are grouped under a parent tool orchestrator.
     * Each subtool is defined with:
     * - orchestrator: The main tool that will be exposed (the index.ts file)
     * - subtools: Array of tools that will be placed in the orchestrator's folder
     *
     * Example structure for 'getCollection':
     * tools/
     *   getCollection/
     *     index.ts          <- orchestrator (handles routing logic)
     *     getCollection.ts  <- subtool (the actual API call)
     *     getCollectionMap.ts <- subtool (the map variant)
     */
    const subtools = {
      getCollection: {
        orchestrator: 'getCollection',
        subtools: ['getCollection', 'getCollectionMap'],
      },
    } as const;
    
    const templated = ['getCollections', 'getWorkspaces'] as const;
    
    export const enabledResources = {
      full,
      minimal,
      code,
      excludedFromGeneration,
      subtools,
      templated,
    };
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, so the description does not need to repeat these. It adds no extra behavioral details beyond what is in the annotations and purpose description.

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, front-loaded with the core purpose, then additional usage guidance. No wasted words.

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

Completeness5/5

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

Despite lacking an output schema, the description specifies the return values (user.id, username, teamId, roles). For a simple getter with no parameters, the description is fully complete.

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?

There are no parameters, and schema coverage is 100%, so the description logically adds no parameter-specific details. Baseline score of 4 for zero-parameter tools is appropriate.

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 title states 'gets information about the authenticated user' and the description explicitly lists specific fields (user.id, username, teamId, roles). No sibling tool serves the same purpose, so it is clearly distinguished.

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

Usage Guidelines5/5

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

The description explicitly advises to call this tool first when a user asks for 'my …' to resolve the user ID. This provides clear context for use without needing to specify alternatives.

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

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