list_users
Retrieve all user profiles stored in the system to view and manage user information.
Instructions
List all user profiles currently stored in the system
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools/userTools.js:51-60 (handler)The handler function for the 'list_users' tool. It imports storage dynamically, retrieves the list of users, formats them in a JSON response, and returns a success message or error.async () => { try { const { storage } = await import('../storage.js'); return utils.createSuccessResponse( `All user profiles (${storage.users.length} total):\n${JSON.stringify(storage.users, null, 2)}` ); } catch (error) { return utils.createErrorResponse(`Error listing users: ${error.message}`); } }
- tools/userTools.js:47-61 (registration)Registers the 'list_users' tool on the MCP server using server.tool(), providing the tool name, description, empty input schema (no parameters required), and the handler function.return server.tool( "list_users", "List all user profiles currently stored in the system", {}, async () => { try { const { storage } = await import('../storage.js'); return utils.createSuccessResponse( `All user profiles (${storage.users.length} total):\n${JSON.stringify(storage.users, null, 2)}` ); } catch (error) { return utils.createErrorResponse(`Error listing users: ${error.message}`); } } );
- index.js:17-17 (registration)Top-level call to listUsersTool(server) in the main server setup, which triggers the registration of the 'list_users' tool.listUsersTool(server);