Skip to main content
Glama
TalissonFV

MCP User Management Server

by TalissonFV

create-user

Adds new user profiles to the MCP User Management Server with required details like name, email, password, address, and phone for streamlined user provisioning.

Instructions

Create a new user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes
emailYes
nameYes
passwordYes
phoneYes

Implementation Reference

  • The handler function for the 'create-user' tool. It calls the createUser helper function with the input parameters and returns a success or failure message.
    async (params) => { try { await createUser(params); return { content: [{ type: "text", text: "User created" }], }; } catch { return { content: [{ type: "text", text: "Failed to save user" }], }; } }
  • Zod schema defining the input parameters for the 'create-user' tool: name, email, password, address, phone.
    { name: z.string(), email: z.string(), password: z.string(), address: z.string(), phone: z.string(), },
  • src/server.ts:33-63 (registration)
    Registration of the 'create-user' tool with McpServer, including name, description, input schema, metadata, and handler function.
    server.tool( "create-user", "Create a new user", { name: z.string(), email: z.string(), password: z.string(), address: z.string(), phone: z.string(), }, { title: "Create User", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true, description: "Create a new user", }, async (params) => { try { await createUser(params); return { content: [{ type: "text", text: "User created" }], }; } catch { return { content: [{ type: "text", text: "Failed to save user" }], }; } } );
  • Helper function that implements the core logic: loads users from JSON, appends new user with generated ID, writes back to file.
    async function createUser(user: { name: string; email: string; password: string; address: string; phone: string }) { const users = await import("./data/users.json", { with: { type: "json" } }).then((m) => m.default); const id = users.length + 1; users.push({ id, ...user }); await fs.writeFile("./src/data/users.json", JSON.stringify(users, null, 2)); return id; }

Other Tools

Related 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/TalissonFV/mcp-test'

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