delete_document
Remove documents from Outline wiki by deleting them permanently or moving to trash. Specify document ID and choose deletion method.
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 implements the delete_document tool logic. It performs access check and calls the Outline API to delete the document, either permanently or to trash.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 schema defining the input for delete_document tool: documentId (string) and optional permanent (boolean, default false).export const deleteDocumentSchema = z.object({ documentId, permanent: z.boolean().default(false) });
- src/lib/tools.ts:102-106 (registration)Registration of the delete_document tool definition, including name, description, and reference to its input schema.createTool( 'delete_document', 'Delete a document. If permanent=true, permanently delete; otherwise move to trash.', 'delete_document' ),
- src/lib/schemas.ts:225-225 (schema)Inclusion of delete_document schema in the central toolSchemas map used for tool definitions.delete_document: deleteDocumentSchema,
- src/lib/handlers/index.ts:22-22 (registration)Composition of document handlers (including delete_document) into the all handlers object....createDocumentHandlers(ctx),