Skip to main content
Glama
DynamicEndpoints

Document Extractor MCP Server

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
NameRequiredDescriptionDefault
idYesDocument ID to delete

Implementation Reference

  • 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.`
            }]

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/DynamicEndpoints/documentation-mcp-using-pocketbase'

If you have feedback or need assistance with the MCP directory API, please join our Discord server