delete_document
Remove a stored document from PocketBase by specifying its unique ID to manage your extracted documentation collection.
Instructions
Delete a document from PocketBase by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Document ID to delete |
Implementation Reference
- server.js:424-434 (handler)The helper function that performs the actual deletion in the PocketBase collection.
async function deleteDocument(id) { await authenticateWhenNeeded(); try { await pb.collection(DOCUMENTS_COLLECTION).delete(id); debugLog('Document deleted from PocketBase', { id }); return true; } catch (error) { debugLog('Error deleting document', { error: error.message, id }); throw new Error(`Failed to delete document: ${error.message}`); } } - server.js:610-626 (registration)The registration of the 'delete_document' MCP tool, which calls the deleteDocument handler.
server.tool( 'delete_document', 'Delete a document from PocketBase by ID', { id: z.string().min(1, 'Document ID is required').describe('Document ID to delete') }, async ({ id }) => { try { await authenticateWhenNeeded(); await deleteDocument(id); return { content: [{ type: 'text', text: `🗑️ Document with ID "${id}" has been deleted successfully.` }]