Skip to main content
Glama

update_user

Modify user details in the MCP JSON Database Server by updating fields like name, email, department, and position using the user's unique ID.

Instructions

Mevcut kullanıcı bilgilerini günceller

Input Schema

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

Implementation Reference

  • Handler function for 'update_user' tool. Finds the user by ID in the database, applies the provided updates, persists changes to the database, and returns the updated user information (excluding password).
    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 }) }] }; }
  • src/index.js:275-289 (registration)
    Registration of the 'update_user' tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    { 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'] } },
  • Input schema definition for the 'update_user' tool, specifying parameters like id (required), name, email, department, position.
    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'] }

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