Skip to main content
Glama
gemini-dk

Firebase MCP Server

by gemini-dk

firestore_delete_document

Remove a specific document from a Firestore collection by providing the collection name and document ID.

Instructions

Delete a document from a Firestore collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesCollection name
idYesDocument ID

Implementation Reference

  • The core handler function that deletes the specified Firestore document and handles errors or missing initialization.
    export async function deleteDocument(collection: string, id: string) { try { if (!db) { return { content: [{ type: 'text', text: 'Firebase is not initialized. SERVICE_ACCOUNT_KEY_PATH environment variable is required.' }], isError: true }; } await db.collection(collection).doc(id).delete(); return { content: [{ type: 'text', text: 'Document deleted successfully' }] }; } catch (error) { return { content: [{ type: 'text', text: `Error deleting document: ${(error as Error).message}` }], isError: true }; } }
  • Defines the input schema for the firestore_delete_document tool, specifying collection and id parameters.
    { name: 'firestore_delete_document', description: 'Delete a document from a Firestore collection', inputSchema: { type: 'object', properties: { collection: { type: 'string', description: 'Collection name' }, id: { type: 'string', description: 'Document ID' } }, required: ['collection', 'id'] } },
  • src/index.ts:242-243 (registration)
    Registers the tool handler in the CallToolRequestSchema switch statement by calling the deleteDocument function.
    case 'firestore_delete_document': return deleteDocument(args.collection as string, args.id as string);
  • src/index.ts:163-180 (registration)
    Registers the tool in the ListToolsRequestSchema response, including name, description, and schema.
    { name: 'firestore_delete_document', description: 'Delete a document from a Firestore collection', inputSchema: { type: 'object', properties: { collection: { type: 'string', description: 'Collection name' }, id: { type: 'string', description: 'Document ID' } }, required: ['collection', 'id'] } },

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/gemini-dk/mcp-server-firebase'

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