n8n_get_current_user
Retrieve details of the authenticated user, including ID, email, name, and role, for identity verification and access control in n8n workflow automation.
Instructions
Get details of the currently authenticated user (owner of the API key).
Returns: Current user details with id, email, name, and role.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/users-sourcecontrol.ts:137-145 (handler)The handler function that executes the logic for n8n_get_current_user by calling /users/me.
async () => { const user = await get<N8nUser>('/users/me'); return { content: [{ type: 'text', text: `**Current User:**\n\n${formatUser(user)}` }], structuredContent: user }; } ); - src/tools/users-sourcecontrol.ts:121-145 (registration)Registration of the n8n_get_current_user tool.
server.registerTool( 'n8n_get_current_user', { title: 'Get Current n8n User', description: `Get details of the currently authenticated user (owner of the API key). Returns: Current user details with id, email, name, and role.`, inputSchema: EmptySchema, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false } }, async () => { const user = await get<N8nUser>('/users/me'); return { content: [{ type: 'text', text: `**Current User:**\n\n${formatUser(user)}` }], structuredContent: user }; } );