getAuthenticatedUser
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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/getAuthenticatedUser.ts:17-43 (handler)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({}); - src/enabledResources.ts:1-262 (registration)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, };