Skip to main content
Glama

list_users

Retrieve all user records from the JSON database. Requires JWT authentication for authorization to access user management data.

Instructions

Tüm kullanıcıları listeler (Yetki gerekli)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesJWT token (yetki kontrolü için)

Implementation Reference

  • The main handler for the 'list_users' tool. Verifies permissions with checkPermissionWithToken, retrieves all users from the database excluding passwords, returns JSON response. Logs denied permissions via auditLogger.
    case 'list_users': { const { token } = args; try { // Yetki kontrolü const user = checkPermissionWithToken(token, PERMISSIONS.USER_LIST); const usersWithoutPasswords = db.users.map(user => { const { password, ...userWithoutPassword } = user; return userWithoutPassword; }); return { content: [{ type: 'text', text: JSON.stringify({ success: true, data: usersWithoutPasswords, requestedBy: { id: user.userId, role: user.role } }, null, 2) }] }; } catch (error) { // Yetki reddedilmesini audit log'a kaydet const failedUser = extractUserFromToken(args.token); if (failedUser) { await auditLogger.permissionDenied(failedUser.userId, failedUser.role, 'list_users', PERMISSIONS.USER_LIST); } return { content: [{ type: 'text', text: JSON.stringify({ success: false, message: error.message, requiredPermission: PERMISSIONS.USER_LIST }) }] }; } }
  • src/index.js:222-231 (registration)
    Registration of the 'list_users' tool in the ListToolsRequestHandler, including name, description, and input schema requiring a JWT token.
    name: 'list_users', description: 'Tüm kullanıcıları listeler (Yetki gerekli)', inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'JWT token (yetki kontrolü için)' } }, required: ['token'] } },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yusuferenkt/mcp-database'

If you have feedback or need assistance with the MCP directory API, please join our Discord server