Skip to main content
Glama

MCP JSON Document Collection Server

by jimpick

delete_json_doc_from_db

Remove a JSON document by its ID from a specified database on the MCP JSON Document Collection Server, enabling efficient document management.

Instructions

Delete a JSON document by ID from a document database

Input Schema

NameRequiredDescriptionDefault
databaseNameNoname of document database to delete from
idNoID of document to delete

Input Schema (JSON Schema)

{ "properties": { "databaseName": { "description": "name of document database to delete from", "type": "string" }, "id": { "description": "ID of document to delete", "type": "string" } }, "type": "object" }

Implementation Reference

  • Handler function for the delete_json_doc_from_db tool. Parses arguments using the schema, retrieves or initializes the database, deletes the document by ID using db.del(), and returns a success message.
    case "delete_json_doc_from_db": { const parsed = DeleteJsonDocFromDbArgsSchema.safeParse(args); if (!parsed.success) { throw new Error(`Invalid arguments for delete_json_doc_from_db: ${parsed.error}`); } const dbName = parsed.data.databaseName; if (!dbs[dbName]) { const newDb = fireproof(dbName); dbs[dbName] = { db: newDb }; } const db = dbs[dbName].db; await db.del(parsed.data.id); return { content: [ { type: "text", text: `Deleted document with ID: ${parsed.data.id}`, }, ], }; }
  • Zod schema defining the input arguments for the delete_json_doc_from_db tool: databaseName (string) and id (string). Used for validation in the handler.
    const DeleteJsonDocFromDbArgsSchema = z.object({ databaseName: z.string(), id: z.string(), });
  • src/index.ts:172-188 (registration)
    Tool registration in the listTools response, including name, description, and inputSchema (JSON Schema matching the Zod schema).
    { name: "delete_json_doc_from_db", description: "Delete a JSON document by ID from a document database", inputSchema: { type: "object", properties: { id: { type: "string", description: "ID of document to delete", }, databaseName: { type: "string", description: "name of document database to delete from", }, } }, },

Other Tools

Related Tools

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/jimpick/mcp-json-db-collection-server'

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