Skip to main content
Glama

create_user

Create new user accounts in BookStack with required name, email, and password fields, plus optional role assignments and language preferences.

Instructions

Create a new user account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesEmail address (required, must be unique)
external_auth_idNoExternal authentication ID
languageNoUser interface language code
nameYesFull name of the user (required)
passwordYesPassword (required, min 8 characters)
rolesNoArray of role IDs to assign to the user
send_inviteNoSend invitation email to user

Implementation Reference

  • Handler logic for the 'create_user' tool. Validates input parameters (name, email, password), constructs the data payload, calls the BookStackClient.createUser method, and formats the API response.
    case "create_user": { const { name, email, password, roles, language, external_auth_id, send_invite, } = args; if (!name || !email || !password) { throw new Error("name, email, and password are required"); } if (password.length < 8) { throw new Error("Password must be at least 8 characters long"); } const data = { name, email, password, roles: roles || [], language, external_auth_id, send_invite, }; const result = await client.createUser(data); return formatApiResponse(result); }
  • MCP tool definition for 'create_user', including name, description, and detailed inputSchema with properties and required fields.
    { name: "create_user", description: "Create a new user account", inputSchema: { type: "object", properties: { name: { type: "string", description: "Full name of the user (required)", }, email: { type: "string", description: "Email address (required, must be unique)", }, password: { type: "string", description: "Password (required, min 8 characters)", }, roles: { type: "array", description: "Array of role IDs to assign to the user", items: { type: "number" }, }, language: { type: "string", description: "User interface language code", }, external_auth_id: { type: "string", description: "External authentication ID", }, send_invite: { type: "boolean", description: "Send invitation email to user", }, }, required: ["name", "email", "password"], }, },
  • src/index.ts:103-128 (registration)
    Registration of 'create_user' tool in the MCP server's CallToolRequest handler. Listed in searchUserToolNames and routed to handleSearchAndUserTool.
    const searchUserToolNames = [ "search_all", "list_users", "get_user", "create_user", "update_user", "delete_user", "list_roles", "get_role", "create_role", "update_role", "delete_role", "list_attachments", "get_attachment", "delete_attachment", "list_images", "get_image", "update_image", "delete_image", ]; if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) { result = await handleSearchAndUserTool(name, args, bookStackClient); } else {
  • BookStackClient helper method that sends POST request to /users endpoint with user data to create a new user.
    async createUser(data: CreateUserRequest): Promise<User> { return this.post<User>("/users", data); }
  • Zod validation schema for CreateUserRequest used in type definitions and potentially for input validation.
    export const CreateUserSchema = z.object({ name: z.string().min(1).max(100), email: z.string().email(), external_auth_id: z.string().optional(), language: z.string().max(15).optional(), password: z.string().min(8).optional(), roles: z.array(z.number()).optional(), send_invite: z.boolean().optional(), }); export const UpdateUserSchema = CreateUserSchema.partial();

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/lautarobarba/bookstack_mcp_server'

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