Skip to main content
Glama
SufyaanKhateeb

User Management MCP Server

create-user

Add new users to the system by providing required details like name, email, address, age, and phone number for user management operations.

Instructions

Create a new user in the system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
emailYes
addressYes
ageYes
phoneYes

Implementation Reference

  • The main handler function for the 'create-user' tool. It calls the createUser helper with the input params, handles success/error responses, and returns formatted content.
    async (params) => {
        try {
            const userId = await createUser(params);
            return {
                content: [
                    {
                        type: "text",
                        text: `User created successfully with ID: ${userId}`,
                    },
                ],
            };
        } catch (error) {
            console.error("Error creating user:", error);
            return {
                content: [
                    {
                        type: "text",
                        text: `Failed to create user`,
                    },
                ],
            };
        }
    }
  • Input schema using Zod for validating parameters: name, email, address, age, phone.
    {
        name: z.string(),
        email: z.string().email(),
        address: z.string(),
        age: z.number().int().min(0),
        phone: z.string(),
    },
  • src/server.ts:81-121 (registration)
    Registration of the 'create-user' tool using server.tool, including name, description, input schema, metadata, and inline handler.
    server.tool(
        "create-user",
        "Create a new user in the system",
        {
            name: z.string(),
            email: z.string().email(),
            address: z.string(),
            age: z.number().int().min(0),
            phone: z.string(),
        },
        {
            title: "Create User",
            readOnlyHint: false,
            destructiveHint: false,
            idempotentHint: false,
            openWorldHint: true,
        },
        async (params) => {
            try {
                const userId = await createUser(params);
                return {
                    content: [
                        {
                            type: "text",
                            text: `User created successfully with ID: ${userId}`,
                        },
                    ],
                };
            } catch (error) {
                console.error("Error creating user:", error);
                return {
                    content: [
                        {
                            type: "text",
                            text: `Failed to create user`,
                        },
                    ],
                };
            }
        }
    );
  • Helper function that loads existing users from JSON, appends a new user with incremented ID, writes back to file, and returns the new ID.
    async function createUser(params: { name: string; email: string; address: string; age: number; phone: string }) {
        const users = await import("./data/users.json", { with: { type: "json" } }).then((m) => m.default);
        const newId = users.length + 1;
        const newUsers = [...users, { id: newId, ...params }];
        writeFileSync("./src/data/users.json", JSON.stringify(newUsers, null, 2));
        return newId;
    }
Behavior3/5

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

The description states 'Create a new user', which aligns with the annotations indicating a write operation (readOnlyHint: false) and non-destructive action (destructiveHint: false). However, it doesn't add meaningful behavioral context beyond what annotations provide, such as authentication requirements, rate limits, or what happens on duplicate entries.

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, clear sentence with no wasted words. It's front-loaded with the core purpose and efficiently communicates the basic action without unnecessary elaboration.

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 tool that creates users with 5 required parameters and no output schema, the description is insufficient. It lacks parameter explanations, usage guidance relative to siblings, and behavioral details not covered by annotations, making it incomplete for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for 5 required parameters, the description provides no information about what 'name', 'email', 'address', 'age', or 'phone' mean in this context. It fails to compensate for the schema's lack of descriptions, leaving parameters semantically undefined.

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 clearly states the action ('Create') and resource ('a new user in the system'), making the purpose immediately understandable. However, it doesn't differentiate from its sibling tool 'create-random-user', which appears to serve a similar purpose but with different parameters or behavior.

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 its sibling 'create-random-user'. There's no mention of prerequisites, alternatives, or specific contexts where this tool is preferred, leaving the agent without 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/SufyaanKhateeb/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server