Skip to main content
Glama

get_chapter

Retrieve chapter details and page contents from BookStack wiki using the chapter ID.

Instructions

Get details of a specific chapter including its pages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesChapter ID

Implementation Reference

  • Handler function for the 'get_chapter' tool. Parses the input ID, fetches the chapter using the BookStack client, and formats the API response.
    case "get_chapter": {
      const id = parseInteger(args.id);
      const result = await client.getChapter(id);
      return formatApiResponse(result);
    }
  • Tool declaration including name, description, and input schema requiring a numeric chapter ID.
    {
      name: "get_chapter",
      description: "Get details of a specific chapter including its pages",
      inputSchema: {
        type: "object",
        properties: {
          id: { type: "number", description: "Chapter ID" },
        },
        required: ["id"],
      },
    },
  • src/index.ts:76-100 (registration)
    Registration in the contentToolNames array, which determines if the tool call is routed to handleContentTool.
    const contentToolNames = [
      "list_books",
      "get_book",
      "create_book",
      "update_book",
      "delete_book",
      "export_book",
      "list_chapters",
      "get_chapter",
      "create_chapter",
      "update_chapter",
      "delete_chapter",
      "export_chapter",
      "list_pages",
      "get_page",
      "create_page",
      "update_page",
      "delete_page",
      "export_page",
      "list_shelves",
      "get_shelf",
      "create_shelf",
      "update_shelf",
      "delete_shelf",
    ];
  • Helper method in BookStackClient that performs the actual API call to retrieve a specific chapter by ID.
    async getChapter(id: number): Promise<Chapter> {
      const response: AxiosResponse<Chapter> = await this.api.get(
        `/chapters/${id}`
      );
      return response.data;
    }
  • src/index.ts:56-59 (registration)
    Tools from createContentTools (which includes 'get_chapter') are added to allTools for listing available tools.
    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