add_user
Add new users to the User Info MCP Server by providing name, email, and phone number for user information management.
Instructions
Yeni kullanıcı ekle
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Kullanıcının tam adı | |
| Yes | E-posta adresi | ||
| phone | Yes | Telefon numarası |
Implementation Reference
- The handler function that executes the add_user tool logic. It calls userService.createUser and returns a formatted MCP response.static async handleAddUser({ name, email, phone }: { name: string; email: string; phone: string }): Promise<ToolResponse> { try { const result = await userService.createUser({ name, email, phone }); return { content: [ { type: "text", text: result.success ? `${result.message}\n${JSON.stringify(result.data, null, 2)}` : result.error || "Kullanıcı oluşturulamadı", }, ], }; } catch (error) { return { content: [ { type: "text", text: "Kullanıcı oluşturma işleminde hata oluştu", }, ], }; } }
- src/types/user.ts:31-35 (schema)Zod schema defining the input parameters for the add_user tool: name, email, phone.export const AddUserInputSchema = { name: z.string().min(2).max(100).describe("Kullanıcının tam adı"), email: z.string().email().describe("E-posta adresi"), phone: z.string().min(10).max(20).describe("Telefon numarası") };
- src/tools/user-tools.ts:74-82 (registration)Registers the 'add_user' tool with the MCP server, specifying name, metadata, input schema, and handler.server.registerTool( "add_user", { title: "Kullanıcı Ekle", description: "Yeni kullanıcı ekle", inputSchema: AddUserInputSchema, }, UserController.handleAddUser );