Skip to main content
Glama

delete_chapter

Remove a chapter by moving it to the recycle bin using its ID, enabling content management in BookStack wiki instances.

Instructions

Delete a chapter (moves to recycle bin)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesChapter ID

Implementation Reference

  • The handler logic for the 'delete_chapter' tool within the handleContentTool function's switch statement. It parses the input ID, calls the BookStackClient's deleteChapter method, and returns a success message.
    case "delete_chapter": { const id = parseInteger(args.id); await client.deleteChapter(id); return `Chapter ${id} deleted successfully`; }
  • The Tool object definition in createContentTools, specifying the name, description, and input schema (requiring a numeric chapter ID) for the 'delete_chapter' tool.
    { name: "delete_chapter", description: "Delete a chapter (moves to recycle bin)", inputSchema: { type: "object", properties: { id: { type: "number", description: "Chapter ID" }, }, required: ["id"], }, },
  • The BookStackClient method deleteChapter that performs the actual API DELETE request to /chapters/{id}, called by the tool handler.
    async deleteChapter(id: number): Promise<void> { return this.delete(`/chapters/${id}`); }
  • src/index.ts:56-59 (registration)
    Registration of content tools (including 'delete_chapter' via createContentTools) into the allTools array, which is returned by the list tools handler.
    const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];
  • src/index.ts:87-87 (registration)
    Explicit inclusion of 'delete_chapter' in the contentToolNames array used to route tool calls to handleContentTool.
    "delete_chapter",

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