Skip to main content
Glama
yusuferenkt

MCP JSON Database Server

by yusuferenkt

update_user

Modify existing user records in the MCP JSON Database Server by updating name, email, department, or position information using the user's ID.

Instructions

Mevcut kullanıcı bilgilerini günceller

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesGüncellenecek kullanıcının ID'si
nameNoYeni kullanıcı adı
emailNoYeni e-posta adresi
departmentNoYeni departman
positionNoYeni pozisyon

Implementation Reference

  • The execution handler for the 'update_user' tool. It locates the user by ID in the database, applies the provided updates, persists changes via writeDatabase, removes password from response, and returns success with updated user data.
    case 'update_user': {
      const { id, ...updates } = args;
      const userIndex = db.users.findIndex(u => u.id === id);
      
      if (userIndex === -1) {
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({ error: 'Kullanıcı bulunamadı' })
          }]
        };
      }
    
      db.users[userIndex] = { ...db.users[userIndex], ...updates };
      await writeDatabase(db);
      
      const { password, ...userWithoutPassword } = db.users[userIndex];
      return {
        content: [{
          type: 'text',
          text: JSON.stringify({ success: true, user: userWithoutPassword })
        }]
      };
    }
  • The input schema and metadata for the 'update_user' tool, defining the expected parameters (user ID required, optional name/email/department/position) as returned in the tools list.
    {
      name: 'update_user',
      description: 'Mevcut kullanıcı bilgilerini günceller',
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'number', description: 'Güncellenecek kullanıcının ID\'si' },
          name: { type: 'string', description: 'Yeni kullanıcı adı' },
          email: { type: 'string', description: 'Yeni e-posta adresi' },
          department: { type: 'string', description: 'Yeni departman' },
          position: { type: 'string', description: 'Yeni pozisyon' }
        },
        required: ['id']
      }
    },
  • src/index.js:60-360 (registration)
    The ListToolsRequestSchema handler registers all tools including 'update_user' by returning the tools array with its schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          // Kimlik doğrulama araçları
          {
            name: 'register',
            description: 'Yeni kullanıcı kaydı oluşturur',
            inputSchema: {
              type: 'object',
              properties: {
                name: { type: 'string', description: 'Kullanıcı adı' },
                email: { type: 'string', description: 'E-posta adresi' },
                password: { type: 'string', description: 'Şifre' },
                department: { type: 'string', description: 'Departman' },
                position: { type: 'string', description: 'Pozisyon' },
                role: { 
                  type: 'string', 
                  enum: ['admin', 'manager', 'employee'], 
                  description: 'Kullanıcı rolü' 
                }
              },
              required: ['name', 'email', 'password', 'department', 'position']
            }
          },
          {
            name: 'login',
            description: 'Kullanıcı giriş yapar ve JWT token alır',
            inputSchema: {
              type: 'object',
              properties: {
                email: { type: 'string', description: 'Kullanıcı e-posta adresi' },
                password: { type: 'string', description: 'Kullanıcı şifresi' }
              },
              required: ['email', 'password']
            }
          },
          {
            name: 'verify_token',
            description: 'JWT token\'ın geçerliliğini kontrol eder',
            inputSchema: {
              type: 'object',
              properties: {
                token: { type: 'string', description: 'JWT token' }
              },
              required: ['token']
            }
          },
          {
            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']
            }
          },
          {
            name: 'get_my_permissions',
            description: 'Kullanıcının sahip olduğu yetkileri listeler',
            inputSchema: {
              type: 'object',
              properties: {
                token: { type: 'string', description: 'JWT token' }
              },
              required: ['token']
            }
          },
    
          // Telefon Transkript Yönetimi
          {
            name: 'list_call_transcripts',
            description: 'Telefon görüşmeleri transkriptlerini listeler',
            inputSchema: {
              type: 'object',
              properties: {
                token: { type: 'string', description: 'JWT token' },
                limit: { type: 'number', description: 'Gösterilecek kayıt sayısı (varsayılan: 50)' },
                category: { type: 'string', description: 'Kategori filtresi (destek, satış, şikayet)' },
                sentiment: { type: 'string', description: 'Duygu durumu filtresi (positive, negative, neutral)' }
              },
              required: ['token']
            }
          },
          {
            name: 'get_call_transcript_by_id',
            description: 'ID\'ye göre telefon transkripti getirir',
            inputSchema: {
              type: 'object',
              properties: {
                token: { type: 'string', description: 'JWT token' },
                id: { type: 'number', description: 'Transkript ID\'si' }
              },
              required: ['token', 'id']
            }
          },
          {
            name: 'search_call_transcripts',
            description: 'Transkriptlerde anahtar kelime arama yapar',
            inputSchema: {
              type: 'object',
              properties: {
                token: { type: 'string', description: 'JWT token' },
                query: { type: 'string', description: 'Aranacak kelime veya cümle' },
                searchIn: { type: 'string', description: 'Arama alanı (transcript, callerName, keywords)', enum: ['transcript', 'callerName', 'keywords', 'all'] }
              },
              required: ['token', 'query']
            }
          },
          {
            name: 'add_call_transcript',
            description: 'Yeni telefon görüşmesi transkripti ekler',
            inputSchema: {
              type: 'object',
              properties: {
                token: { type: 'string', description: 'JWT token' },
                callerPhone: { type: 'string', description: 'Arayan telefon numarası' },
                callerName: { type: 'string', description: 'Arayan kişi adı' },
                callerCompany: { type: 'string', description: 'Arayan şirket' },
                transcript: { type: 'string', description: 'Konuşma transkripti' },
                duration: { type: 'number', description: 'Görüşme süresi (saniye)' },
                category: { type: 'string', description: 'Kategori (destek, satış, şikayet)' },
                priority: { type: 'string', description: 'Öncelik (low, normal, high, urgent)' },
                keywords: { type: 'array', items: { type: 'string' }, description: 'Anahtar kelimeler' }
              },
              required: ['token', 'callerPhone', 'callerName', 'transcript', 'duration', 'category']
            }
          },
          {
            name: 'update_call_transcript',
            description: 'Mevcut transkripti günceller',
            inputSchema: {
              type: 'object',
              properties: {
                token: { type: 'string', description: 'JWT token' },
                id: { type: 'number', description: 'Transkript ID\'si' },
                resolution: { type: 'string', description: 'Çözüm durumu' },
                followUpRequired: { type: 'boolean', description: 'Takip gerekli mi?' },
                assignedTo: { type: 'number', description: 'Atanan kullanıcı ID\'si' }
              },
              required: ['token', 'id']
            }
          },
          {
            name: 'get_call_analytics',
            description: 'Çağrı analitikleri ve istatistikleri getirir',
            inputSchema: {
              type: 'object',
              properties: {
                token: { type: 'string', description: 'JWT token' },
                date: { type: 'string', description: 'Analiz tarihi (YYYY-MM-DD)' },
                period: { type: 'string', description: 'Analiz periyodu (daily, weekly, monthly)', enum: ['daily', 'weekly', 'monthly'] }
              },
              required: ['token']
            }
          },
    
          // Kullanıcı yönetimi araçları
          {
            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']
            }
          },
          {
            name: 'get_user_by_id',
            description: 'ID\'ye göre kullanıcı bilgilerini getirir (Yetki gerekli)',
            inputSchema: {
              type: 'object',
              properties: {
                id: { type: 'number', description: 'Kullanıcı ID\'si' },
                token: { type: 'string', description: 'JWT token (yetki kontrolü için)' }
              },
              required: ['id', 'token']
            }
          },
          {
            name: 'search_users',
            description: 'Kullanıcıları ad, email, departman veya pozisyona göre arar',
            inputSchema: {
              type: 'object',
              properties: {
                query: { type: 'string', description: 'Arama terimi' }
              },
              required: ['query']
            }
          },
          {
            name: 'add_user',
            description: 'Yeni kullanıcı ekler',
            inputSchema: {
              type: 'object',
              properties: {
                name: { type: 'string', description: 'Kullanıcı adı' },
                email: { type: 'string', description: 'E-posta adresi' },
                department: { type: 'string', description: 'Departman' },
                position: { type: 'string', description: 'Pozisyon' },
                joinDate: { type: 'string', description: 'İşe giriş tarihi (YYYY-MM-DD formatında)' },
                salary: { type: 'number', description: 'Maaş (opsiyonel)' },
                birthDate: { type: 'string', description: 'Doğum tarihi (YYYY-MM-DD formatında, opsiyonel)' },
                phone: { type: 'string', description: 'Telefon numarası (opsiyonel)' },
                address: { type: 'string', description: 'Adres (opsiyonel)' },
                skills: { type: 'array', items: { type: 'string' }, description: 'Yetenekler listesi (opsiyonel)' }
              },
              required: ['name', 'email', 'department', 'position', 'joinDate']
            }
          },
          {
            name: 'update_user',
            description: 'Mevcut kullanıcı bilgilerini günceller',
            inputSchema: {
              type: 'object',
              properties: {
                id: { type: 'number', description: 'Güncellenecek kullanıcının ID\'si' },
                name: { type: 'string', description: 'Yeni kullanıcı adı' },
                email: { type: 'string', description: 'Yeni e-posta adresi' },
                department: { type: 'string', description: 'Yeni departman' },
                position: { type: 'string', description: 'Yeni pozisyon' }
              },
              required: ['id']
            }
          },
          {
            name: 'delete_user',
            description: 'Kullanıcıyı siler',
            inputSchema: {
              type: 'object',
              properties: {
                id: { type: 'number', description: 'Silinecek kullanıcının ID\'si' }
              },
              required: ['id']
            }
          },
    
    
    
          // Audit Log yönetimi araçları
          {
            name: 'get_my_audit_logs',
            description: 'Kullanıcının kendi audit loglarını getirir',
            inputSchema: {
              type: 'object',
              properties: {
                token: { type: 'string', description: 'JWT token' },
                limit: { type: 'number', description: 'Gösterilecek log sayısı (varsayılan: 50)' }
              },
              required: ['token']
            }
          },
          {
            name: 'get_all_audit_logs',
            description: 'Tüm audit logları getirir (Sadece admin)',
            inputSchema: {
              type: 'object',
              properties: {
                token: { type: 'string', description: 'JWT token' },
                limit: { type: 'number', description: 'Gösterilecek log sayısı (varsayılan: 200)' }
              },
              required: ['token']
            }
          },
          {
            name: 'get_audit_logs_by_category',
            description: 'Belirli kategorideki audit logları getirir (Admin/Manager)',
            inputSchema: {
              type: 'object',
              properties: {
                token: { type: 'string', description: 'JWT token' },
                category: { type: 'string', description: 'Log kategorisi (authentication, user_management, data_access, permission, system, security)' },
                limit: { type: 'number', description: 'Gösterilecek log sayısı (varsayılan: 100)' }
              },
              required: ['token', 'category']
            }
          },
          {
            name: 'get_audit_logs_by_date',
            description: 'Belirli tarih aralığındaki audit logları getirir (Admin/Manager)',
            inputSchema: {
              type: 'object',
              properties: {
                token: { type: 'string', description: 'JWT token' },
                startDate: { type: 'string', description: 'Başlangıç tarihi (YYYY-MM-DD)' },
                endDate: { type: 'string', description: 'Bitiş tarihi (YYYY-MM-DD)' },
                limit: { type: 'number', description: 'Gösterilecek log sayısı (varsayılan: 100)' }
              },
              required: ['token', 'startDate', 'endDate']
            }
          },
    
    
        ]
      };
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is an update operation, implying mutation, but doesn't mention required permissions, whether changes are reversible, potential side effects, or error conditions. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 without unnecessary words. It's appropriately sized and front-loaded, with zero wasted content.

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 mutation tool with 5 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens when fields are omitted, what the return value looks like, or any behavioral constraints. The agent lacks crucial context for proper tool invocation.

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 5 parameters well-documented in the schema (id, name, email, department, position). The description doesn't add any parameter-specific information beyond what's already in the schema, so it meets the baseline of 3 where the schema does the heavy lifting.

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 'Mevcut kullanıcı bilgilerini günceller' (Updates existing user information) clearly states the verb (günceller/updates) and resource (kullanıcı/user), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'add_user' or 'change_password', which would require more specific scope definition to earn a 5.

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 like 'add_user' (for creating new users) or 'change_password' (for password-specific updates). There's no mention of prerequisites, context, or exclusions, leaving the agent with minimal usage direction.

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