ninja_list_end_users
List end users from NinjaOne with pagination and optional organization filter. Access user data for account management and reporting.
Instructions
List all end users.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageSize | No | Max results to return | |
| after | No | Last end user ID for pagination | |
| organizationId | No | Filter by organization |
Implementation Reference
- src/tools/users.ts:66-67 (handler)The actual handler function for 'ninja_list_end_users'. It makes a GET request to '/user/end-users' via the NinjaOneClient, passing cleaned arguments (pageSize, after, organizationId) as query parameters.
handler: async (args, client: NinjaOneClient) => client.get('/user/end-users', clean(args)), - src/tools/users.ts:57-64 (schema)Input validation schema for the 'ninja_list_end_users' tool. Accepts optional pageSize, after (pagination cursor), and organizationId query parameters.
inputSchema: { type: 'object', properties: { pageSize: { type: 'number', description: 'Max results to return' }, after: { type: 'number', description: 'Last end user ID for pagination' }, organizationId: { type: 'number', description: 'Filter by organization' }, }, }, - src/tools/users.ts:53-68 (registration)Tool registration entry in the userTools array (lines 53-68). The tool is named 'ninja_list_end_users' with its schema and handler bundled together as a ToolDef object.
{ tool: { name: 'ninja_list_end_users', description: 'List all end users.', inputSchema: { type: 'object', properties: { pageSize: { type: 'number', description: 'Max results to return' }, after: { type: 'number', description: 'Last end user ID for pagination' }, organizationId: { type: 'number', description: 'Filter by organization' }, }, }, }, handler: async (args, client: NinjaOneClient) => client.get('/user/end-users', clean(args)), }, - src/tools/index.ts:21-21 (registration)The userTools array (containing ninja_list_end_users) is spread into the ALL_TOOLS array, which is then used to register all tools with the MCP server in src/index.ts.
...userTools, - src/index.ts:24-33 (registration)The MCP server maps all tool names to their handlers (line 24) and registers them via ListToolsRequestSchema (line 31-33). When 'ninja_list_end_users' is called, the handler from users.ts is invoked.
const toolMap = new Map(ALL_TOOLS.map((def) => [def.tool.name, def.handler])); const server = new Server( { name: 'ninjaone-mcp', version: '1.0.0' }, { capabilities: { tools: {} } }, ); server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: ALL_TOOLS.map((def) => def.tool), }));