Skip to main content
Glama

list_users

Retrieve a list of all users with proper JWT authentication in the MCP JSON Database Server to streamline user management and access control.

Instructions

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

Input Schema

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

Implementation Reference

  • The handler case for 'list_users' tool execution. Performs permission check, filters out passwords from user data, returns formatted JSON response, and logs permission denials.
    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)
    Tool registration in ListTools handler, defining name, description, and input schema for 'list_users'.
    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'] } },
  • Input schema definition for the 'list_users' tool, requiring a JWT token for authorization.
    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