Skip to main content
Glama

create_book

Add a new book to your BookStack wiki by specifying its name, description, and optional tags or templates for organized content management.

Instructions

Create a new book in the system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesBook name (required, max 255 chars)
descriptionNoBook description (plain text)
description_htmlNoBook description (HTML format)
tagsNoArray of tags with name and value
default_template_idNoDefault template ID for new pages

Implementation Reference

  • Executes the create_book tool: parses args with CreateBookSchema, converts tags, calls BookStackClient.createBook, and returns formatted response.
    case "create_book": {
      const validatedData = CreateBookSchema.parse(args);
      const data = {
        ...validatedData,
        tags: convertTags(validatedData.tags),
      };
      const result = await client.createBook(data);
      return formatApiResponse(result);
    }
  • MCP Tool object registration for 'create_book' including name, description, and input schema definition.
    {
      name: "create_book",
      description: "Create a new book in the system",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Book name (required, max 255 chars)",
          },
          description: {
            type: "string",
            description: "Book description (plain text)",
          },
          description_html: {
            type: "string",
            description: "Book description (HTML format)",
          },
          tags: {
            type: "array",
            description: "Array of tags with name and value",
            items: {
              type: "object",
              properties: {
                name: { type: "string" },
                value: { type: "string" },
                order: { type: "number" },
              },
              required: ["name", "value"],
            },
          },
          default_template_id: {
            type: "number",
            description: "Default template ID for new pages",
          },
        },
        required: ["name"],
      },
  • Zod validation schema for create_book input parameters, used in the handler for parsing and validation.
    export const CreateBookSchema = z.object({
      name: z.string().min(1).max(255),
      description: z.string().optional(),
      description_html: z.string().optional(),
      tags: z.array(TagSchema).optional(),
      default_template_id: z.number().optional(),
    });
  • BookStackClient helper method that sends POST request to /books API endpoint to create the book.
    async createBook(data: CreateBookRequest): Promise<Book> {
      return this.post<Book>("/books", data);
    }
  • src/index.ts:56-60 (registration)
    Top-level tool list registration including content tools (which contains create_book) for the MCP server.
    const allTools: Tool[] = [
      ...createContentTools(bookStackClient),
      ...createSearchAndUserTools(bookStackClient),
    ];

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