conf_delete
Delete Confluence pages, blog posts, comments, attachments, or labels using API endpoints to remove outdated or unnecessary content from your knowledge base.
Instructions
Delete Confluence resources. Returns TOON format by default.
Output format: TOON (default) or JSON (outputFormat: "json")
Common operations:
/wiki/api/v2/pages/{id}- Delete page/wiki/api/v2/blogposts/{id}- Delete blog post/wiki/api/v2/pages/{id}/labels/{label-id}- Remove label/wiki/api/v2/footer-comments/{id}- Delete comment/wiki/api/v2/attachments/{id}- Delete attachment
Note: Most DELETE endpoints return 204 No Content on success.
API reference: https://developer.atlassian.com/cloud/confluence/rest/v2/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The Confluence API endpoint path (without base URL). Must start with "/". Examples: "/wiki/api/v2/spaces", "/wiki/api/v2/pages", "/wiki/api/v2/pages/{id}" | |
| queryParams | No | Optional query parameters as key-value pairs. Examples: {"limit": "25", "cursor": "...", "space-id": "123", "body-format": "storage"} | |
| jq | No | JMESPath expression to filter/transform the response. IMPORTANT: Always use this to extract only needed fields and reduce token costs. Examples: "results[*].{id: id, title: title}" (extract specific fields), "results[0]" (first result), "results[*].id" (IDs only). See https://jmespath.org | |
| outputFormat | No | Output format: "toon" (default, 30-60% fewer tokens) or "json". TOON is optimized for LLMs with tabular arrays and minimal syntax. |
Implementation Reference
- The handleDelete controller function that executes the DELETE API request logic for the conf_delete tool. Delegates to shared handleRequest which handles service call, JQ filtering, and output formatting.export async function handleDelete( options: GetApiToolArgsType, ): Promise<ControllerResponse> { return handleRequest('DELETE', options); }
- src/tools/atlassian.api.tool.ts:281-289 (registration)Registers the 'conf_delete' MCP tool with the server, providing title, description, input schema (DeleteApiToolArgs), and the 'del' handler function.server.registerTool( 'conf_delete', { title: 'Confluence DELETE Request', description: CONF_DELETE_DESCRIPTION, inputSchema: DeleteApiToolArgs, }, del, );
- Zod schema definition for conf_delete tool inputs, equivalent to GetApiToolArgs (path, optional queryParams/jq/outputFormat, no body)./** * Schema for conf_delete tool arguments (DELETE requests - no body) */ export const DeleteApiToolArgs = GetApiToolArgs; export type DeleteApiToolArgsType = GetApiToolArgsType;
- src/tools/atlassian.api.tool.ts:33-69 (handler)createReadHandler factory creates the MCP tool executor for conf_delete (invoked as 'del' = createReadHandler('DELETE', handleDelete)), handling MCP input/output format, logging, truncation, and error formatting before/after calling controller.function createReadHandler( methodName: string, handler: ( options: GetApiToolArgsType, ) => Promise<{ content: string; rawResponsePath?: string | null }>, ) { return async (args: Record<string, unknown>) => { const methodLogger = Logger.forContext( 'tools/atlassian.api.tool.ts', methodName.toLowerCase(), ); methodLogger.debug(`Making ${methodName} request with args:`, args); try { const result = await handler(args as GetApiToolArgsType); methodLogger.debug( 'Successfully retrieved response from controller', ); return { content: [ { type: 'text' as const, text: truncateForAI( result.content, result.rawResponsePath, ), }, ], }; } catch (error) { methodLogger.error(`Failed to make ${methodName} request`, error); return formatErrorForMcpTool(error); } }; }
- Instantiates the specific 'del' handler for conf_delete by calling createReadHandler with 'DELETE' method name and handleDelete controller.const del = createReadHandler('DELETE', handleDelete);