Skip to main content
Glama

create_user

Add new user accounts to BookStack wiki with required details like name, email, password, and optional role assignments.

Instructions

Create a new user account

Input Schema

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

Implementation Reference

  • Handler logic for the 'create_user' tool in handleSearchAndUserTool function. Validates inputs, constructs data object, calls BookStackClient.createUser, and formats 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);
    }
  • Tool registration object defining the 'create_user' tool, including name, description, and inputSchema. Returned by createSearchAndUserTools and included in MCP server's tool list.
    {
      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"],
      },
    },
  • Zod schema for user creation input validation (CreateUserSchema), matching the tool's inputSchema.
    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(),
    });
  • BookStackClient method that performs the actual API POST to /users endpoint to create the user.
    async createUser(data: CreateUserRequest): Promise<User> {
      return this.post<User>("/users", data);
  • TypeScript interface defining the shape of CreateUserRequest used by the client and handler.
    export interface CreateUserRequest {
      name: string;
      email: string;
      external_auth_id?: string;
      language?: string;
      password?: string;
      roles?: number[];
      send_invite?: boolean;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but only states the basic action. It doesn't mention authentication requirements, whether the operation is idempotent, what happens on duplicate email, rate limits, or what the response contains. 'Create' implies mutation but lacks critical behavioral context.

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, efficient sentence with zero wasted words. It's appropriately sized for a straightforward creation tool and gets directly to the point 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 mutation tool with 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens after creation, error conditions, permissions needed, or how this fits into the broader user management system. The agent lacks critical context for proper tool invocation.

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%, so parameters are fully documented in the schema. The description adds no additional parameter information beyond what's in the schema, but doesn't need to since the schema is comprehensive. Baseline 3 is appropriate when schema does the heavy lifting.

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 ('new user account'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'create_role' or 'create_book' beyond the resource type, and doesn't specify what constitutes a 'user account' in this system context.

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 like 'update_user' or 'get_user', nor does it mention prerequisites, permissions required, or typical workflows. The agent must infer usage from the tool name alone.

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

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