list_users
Retrieve and display all user profiles stored in the MCP User Profile Management Server to manage and review account information effectively.
Instructions
List all user profiles currently stored in the system
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- tools/userTools.js:51-60 (handler)The handler function for the 'list_users' tool. It dynamically imports storage.js, retrieves the list of users, and returns a formatted success response with the user data in JSON.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:50-50 (schema)Input schema for the 'list_users' tool, which is an empty object indicating no input parameters are required.{},
- tools/userTools.js:47-61 (registration)The server.tool() call inside listUsersTool() that registers the 'list_users' tool on the MCP server, providing name, description, schema, and handler.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)Invocation of the listUsersTool function to register the 'list_users' tool on the main MCP server instance.listUsersTool(server);