Skip to main content
Glama
yusuferenkt

MCP JSON Database Server

by yusuferenkt

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']
      }
    },
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions authorization requirements, which is valuable context. However, it doesn't describe what 'listeler' entails (e.g., pagination, sorting, format of returned data, rate limits, or whether it's a read-only operation), leaving significant gaps in behavioral understanding.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the purpose and authorization requirement without any wasted words. It's appropriately sized and front-loaded with essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one parameter (fully documented in schema) and no output schema, the description is minimally adequate. It covers the basic purpose and authorization need but lacks details on output format, behavioral traits (like pagination), and differentiation from siblings, which would enhance completeness given the tool's role in a user management context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'token' documented as a JWT token for authorization control. The description doesn't add any meaning beyond what the schema provides (e.g., it doesn't explain token acquisition or format details), so it meets the baseline for high schema coverage without compensation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('listeler' - lists) and resource ('tüm kullanıcıları' - all users), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'search_users' or 'get_user_by_id', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions authorization is required ('Yetki gerekli'), which provides some context about prerequisites. However, it offers no guidance on when to use this tool versus alternatives like 'search_users' or 'get_user_by_id', nor does it specify any exclusions or specific scenarios for its use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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