Skip to main content
Glama

register

Create new user accounts in the JSON Database Server by providing name, email, password, department, position, and role details for system access.

Instructions

Yeni kullanıcı kaydı oluşturur

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesKullanıcı adı
emailYesE-posta adresi
passwordYesŞifre
departmentYesDepartman
positionYesPozisyon
roleNoKullanıcı rolü

Implementation Reference

  • The core handler for the 'register' tool. Validates email uniqueness, hashes the password using hashPassword from auth.js, generates a new user ID, adds the user to the database, persists changes, and returns a success response with user details.
    case 'register': { const { name: userName, email, password, department, position, role = 'employee' } = args; // E-posta kontrolü const existingUser = db.users.find(u => u.email === email); if (existingUser) { return { content: [{ type: 'text', text: JSON.stringify({ success: false, message: 'Bu e-posta adresi zaten kayıtlı' }) }] }; } // Şifreyi hash'le const hashedPassword = await hashPassword(password); // Yeni kullanıcı oluştur const newUser = { id: generateId(db.users), name: userName, email, password: hashedPassword, department, position, role, joinDate: new Date().toISOString().split('T')[0] }; db.users.push(newUser); await writeDatabase(db); return { content: [{ type: 'text', text: JSON.stringify({ success: true, message: 'Kullanıcı başarıyla kaydedildi', user: { id: newUser.id, name: userName, email, role } }) }] }; }
  • src/index.js:65-82 (registration)
    The 'register' tool registration in the ListToolsRequestSchema response, including name, description, and input schema definition.
    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'] }
  • Input schema definition for the 'register' tool, specifying required fields and types for user registration.
    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'] }

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