Skip to main content
Glama
yusuferenkt

MCP JSON Database Server

by yusuferenkt

add_user

Add new user records to the JSON database by providing required details like name, email, department, position, and join date. Supports optional fields for salary, skills, and contact information.

Instructions

Yeni kullanıcı ekler

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesKullanıcı adı
emailYesE-posta adresi
departmentYesDepartman
positionYesPozisyon
joinDateYesİşe giriş tarihi (YYYY-MM-DD formatında)
salaryNoMaaş (opsiyonel)
birthDateNoDoğum tarihi (YYYY-MM-DD formatında, opsiyonel)
phoneNoTelefon numarası (opsiyonel)
addressNoAdres (opsiyonel)
skillsNoYetenekler listesi (opsiyonel)

Implementation Reference

  • The core handler logic for the 'add_user' tool. It generates a new unique ID for the user using generateId, spreads the input arguments into the new user object, appends it to the database's users array, persists the database changes with writeDatabase, and returns a success response with the new user data.
    case 'add_user': {
      const newUser = {
        id: generateId(db.users),
        ...args
      };
      
      db.users.push(newUser);
      await writeDatabase(db);
      
      return {
        content: [{
          type: 'text',
          text: JSON.stringify({ success: true, user: newUser })
        }]
      };
    }
  • The input schema definition for the 'add_user' tool, specifying properties, types, descriptions, and required fields for validation.
    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']
    }
  • src/index.js:255-274 (registration)
    The tool registration object in the ListTools response, including name, description, and inputSchema.
    {
      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']
      }
    },
  • Utility function generateId used in the add_user handler to compute the next available user ID by finding the maximum existing ID and incrementing it.
    export function generateId(items) {
        if (!items || items.length === 0) return 1;
        return Math.max(...items.map(item => item.id)) + 1;
    }
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Yeni kullanıcı ekler' only states the action without any details on permissions required, whether the operation is idempotent, what happens on duplicate entries, error conditions, or the response format. For a mutation tool with zero annotation coverage, this is a critical gap that leaves the agent guessing about important behavioral traits.

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 extremely concise with just three words ('Yeni kullanıcı ekler'), making it front-loaded and efficient. There's zero waste or redundancy—every word contributes directly to stating the tool's purpose. This is an example of optimal brevity for a simple action description.

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?

Given the complexity of a user creation tool with 10 parameters, no annotations, and no output schema, the description is incomplete. It fails to address critical context such as authentication requirements, permission levels, what the tool returns upon success or failure, and how it differs from similar tools like 'register'. The agent lacks sufficient information to use this tool effectively in a real-world scenario.

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 10 parameters clearly documented in Turkish (e.g., 'Kullanıcı adı' for name, 'E-posta adresi' for email). The description adds no parameter information beyond what the schema provides. According to the rules, when schema coverage is high (>80%), the baseline score is 3 even with no param info in the description, which applies here.

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 'Yeni kullanıcı ekler' (Adds new user) clearly states the verb ('adds') and resource ('user'), making the purpose immediately understandable. It distinguishes from siblings like 'update_user' or 'delete_user' by specifying creation rather than modification or removal. However, it doesn't specify what kind of user (e.g., system user, employee) or in what context, leaving some ambiguity.

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., authentication, permissions), when not to use it (e.g., for existing users), or direct alternatives like 'register' or 'update_user'. The agent must infer usage from the name alone, which is insufficient for optimal tool selection.

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