Skip to main content
Glama

delete_chapter

Remove a chapter from BookStack by moving it to the recycle bin using its ID.

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 switch statement. It parses the chapter ID from arguments and calls BookStackClient.deleteChapter(id), returning a success message.
    case "delete_chapter": { const id = parseInteger(args.id); await client.deleteChapter(id); return `Chapter ${id} deleted successfully`; }
  • Tool definition providing the schema for 'delete_chapter', including input validation requiring a numeric chapter ID.
    { name: "delete_chapter", description: "Delete a chapter (moves to recycle bin)", inputSchema: { type: "object", properties: { id: { type: "number", description: "Chapter ID" }, }, required: ["id"], }, },
  • src/index.ts:62-66 (registration)
    MCP server ListToolsRequest handler returns allTools, which includes the 'delete_chapter' tool schema from createContentTools.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: allTools, }; });
  • src/index.ts:124-128 (registration)
    MCP server CallToolRequest handler dispatches 'delete_chapter' calls to handleContentTool based on inclusion in contentToolNames.
    if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) { result = await handleSearchAndUserTool(name, args, bookStackClient); } else {
  • BookStackClient.deleteChapter method implements the core API deletion by calling DELETE /chapters/{id}.
    async deleteChapter(id: number): Promise<void> { return this.delete(`/chapters/${id}`); }

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