Skip to main content
Glama
jimpick

MCP JSON Document Collection Server

by jimpick

delete_json_doc_from_db

Remove a JSON document from a database by specifying its unique ID, enabling document management and cleanup in Fireproof JSON databases.

Instructions

Delete a JSON document by ID from a document database

Input Schema

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

Implementation Reference

  • The handler logic for the 'delete_json_doc_from_db' tool. It validates input using DeleteJsonDocFromDbArgsSchema, ensures the database exists (creating if necessary), 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, specifying name, description, and input schema (JSON Schema object).
    {
      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",
          },
        }
      },
    },
  • JSON Schema in the tool registration for input validation, matching the Zod schema structure.
    type: "object",
    properties: {
      id: {
        type: "string",
        description: "ID of document to delete",
      },
      databaseName: {
        type: "string",
        description: "name of document database to delete from",
      },
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the basic action without disclosing critical behavioral traits. It doesn't mention whether deletion is permanent, requires specific permissions, has side effects (e.g., on related data), or provides confirmation feedback, leaving significant gaps for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence that efficiently conveys the core action without unnecessary words. It's front-loaded with the verb 'Delete' and avoids redundancy, making it easy to parse quickly while covering essential elements.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral aspects (e.g., permanence, error handling), output expectations, or integration with sibling tools, failing to provide sufficient context for safe and effective use in this complex environment.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('id' and 'databaseName') adequately. The description adds no additional meaning beyond what the schema provides, such as format examples or constraints, but doesn't need to compensate given the high coverage, resulting in a baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and resource ('JSON document by ID from a document database'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'delete_json_doc_database' (which deletes entire databases) or 'load_json_doc_from_db' (which retrieves documents), leaving some ambiguity about scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'delete_json_doc_database' (for deleting databases) or 'save_json_doc_to_db' (for updates). The description lacks context about prerequisites (e.g., needing an existing document ID) or exclusions (e.g., not for bulk deletions), offering minimal usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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