Skip to main content
Glama

register

Create a new user account in the MCP JSON Database Server by submitting name, email, password, department, position, and role details. Supports user management with secure JWT authentication.

Instructions

Yeni kullanıcı kaydı oluşturur

Input Schema

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

Implementation Reference

  • Main handler for 'register' tool: checks for existing email, hashes password using auth.js function, generates ID using database.js, creates and saves new user to database, returns JSON success response with user info.
    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 } }) }] }; }
  • Input schema definition for 'register' tool specifying required fields and types for new 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'] }
  • src/index.js:64-83 (registration)
    Tool registration in ListToolsRequestSchema handler: defines name, description, and input schema for the 'register' tool.
    { 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'] } },

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