Skip to main content
Glama
yusuferenkt

MCP JSON Database Server

by yusuferenkt

change_password

Update user password securely in the MCP JSON Database Server by providing current and new credentials with JWT authentication.

Instructions

Kullanıcı şifresini değiştirir

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesJWT token
oldPasswordYesMevcut şifre
newPasswordYesYeni şifre

Implementation Reference

  • The handler function for the 'change_password' tool. Verifies the user's token, checks the old password, hashes the new password using hashPassword, updates the user record in the database, and returns a JSON response indicating success or failure.
    case 'change_password': {
      const { token, oldPassword, newPassword } = args;
      
      try {
        const decoded = verifyToken(token);
        const user = db.users.find(u => u.id === decoded.userId);
        
        if (!user) {
          return {
            content: [{
              type: 'text',
              text: JSON.stringify({ success: false, message: 'Kullanıcı bulunamadı' })
            }]
          };
        }
    
        // Eski şifreyi kontrol et
        const isOldPasswordValid = await comparePassword(oldPassword, user.password);
        if (!isOldPasswordValid) {
          return {
            content: [{
              type: 'text',
              text: JSON.stringify({ success: false, message: 'Mevcut şifre yanlış' })
            }]
          };
        }
    
        // Yeni şifreyi hash'le ve güncelle
        user.password = await hashPassword(newPassword);
        await writeDatabase(db);
    
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({ success: true, message: 'Şifre başarıyla değiştirildi' })
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({ success: false, message: error.message })
          }]
        };
      }
    }
  • src/index.js:108-119 (registration)
    Registration of the 'change_password' tool in the MCP tools array, including name, description, and input schema definition.
      name: 'change_password',
      description: 'Kullanıcı şifresini değiştirir',
      inputSchema: {
        type: 'object',
        properties: {
          token: { type: 'string', description: 'JWT token' },
          oldPassword: { type: 'string', description: 'Mevcut şifre' },
          newPassword: { type: 'string', description: 'Yeni şifre' }
        },
        required: ['token', 'oldPassword', 'newPassword']
      }
    },
  • Input schema definition for the change_password tool, specifying required fields: token, oldPassword, newPassword.
    inputSchema: {
      type: 'object',
      properties: {
        token: { type: 'string', description: 'JWT token' },
        oldPassword: { type: 'string', description: 'Mevcut şifre' },
        newPassword: { type: 'string', description: 'Yeni şifre' }
      },
      required: ['token', 'oldPassword', 'newPassword']
    }
Behavior2/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 states the action (password change) but doesn't mention critical behavioral aspects: whether this requires authentication (implied by token parameter but not stated), if it's destructive (password changes are irreversible), rate limits, error conditions, or what happens on success. For a security-sensitive mutation tool, this is a significant gap.

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 in Turkish that directly states the tool's purpose with zero wasted words. It's appropriately sized for a straightforward tool and front-loads the essential information without unnecessary elaboration.

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

Completeness2/5

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

For a password change tool with no annotations and no output schema, the description is insufficient. It doesn't cover authentication requirements, security implications, success/failure behavior, or return values. Given the complexity and sensitivity of password operations, the description should provide more context about how the tool behaves and what to expect.

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 all three parameters (token, oldPassword, newPassword) clearly documented in the schema. The description doesn't add any parameter-specific information beyond what's in the schema. The baseline score of 3 reflects adequate parameter documentation through the schema alone, with no additional value from the description.

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 'Kullanıcı şifresini değiştirir' (Changes user password) clearly states the verb (change) and resource (user password) in a specific action. It distinguishes from siblings like 'login', 'register', and 'update_user' by focusing specifically on password modification rather than general user updates or authentication actions.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., user must be logged in), when not to use it (e.g., for password reset vs. change), or how it differs from related tools like 'update_user' which might also handle password updates. The agent must infer usage from context alone.

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