delete_document
Remove documents from Outline wiki by deleting permanently or moving to trash, based on specified parameters.
Instructions
Delete a document. If permanent=true, permanently delete; otherwise move to trash.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentId | Yes | ||
| permanent | No |
Implementation Reference
- src/lib/handlers/documents.ts:124-135 (handler)The core handler function that executes the delete_document tool logic by invoking the Outline API to delete the specified document, optionally permanently.async delete_document(args: DeleteDocumentInput) { checkAccess(config, 'delete_document'); await apiCall(() => apiClient.post('/documents.delete', { id: args.documentId, permanent: args.permanent }) ); return { success: true, documentId: args.documentId, permanent: args.permanent, message: args.permanent ? MESSAGES.DOCUMENT_DELETED_PERMANENT : MESSAGES.DOCUMENT_DELETED, }; },
- src/lib/schemas.ts:69-69 (schema)Zod input schema for the delete_document tool defining documentId (required string) and permanent (optional boolean, defaults to false).export const deleteDocumentSchema = z.object({ documentId, permanent: z.boolean().default(false) });
- src/lib/tools.ts:103-106 (registration)Registers the MCP tool definition for delete_document, including name, description, and JSON schema derived from Zod schema.'delete_document', 'Delete a document. If permanent=true, permanently delete; otherwise move to trash.', 'delete_document' ),
- src/lib/handlers/index.ts:19-28 (registration)Combines and registers all handlers, including the document handlers (which contain delete_document) into a single ToolHandlers object.export function createAllHandlers(ctx: AppContext): ToolHandlers { return { ...createSearchHandlers(ctx), ...createDocumentHandlers(ctx), ...createCollectionHandlers(ctx), ...createCommentHandlers(ctx), ...createBatchHandlers(ctx), ...createSmartHandlers(ctx), } as ToolHandlers; }
- src/lib/access-control.ts:33-33 (helper)Includes 'delete_document' in the DELETE_TOOLS set used for access control checks to enforce delete restrictions.'delete_document',