Skip to main content
Glama
vjsr007
by vjsr007

index-delete

Remove indexed notes by ID or key from the MCP Index Notes server. Returns a count or boolean confirmation for deleted entries, ensuring precise note management.

Instructions

Delete notes by id or by key. Returns count/boolean.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNo
keyNo

Implementation Reference

  • Main handler for the 'index-delete' MCP tool. Parses arguments using DeleteSchema, then calls db.deleteById(id) or db.deleteByKey(key) accordingly, returning JSON result.
    case 'index-delete': {
      const parsed = DeleteSchema.parse(args ?? {});
      if (parsed.id) {
        const ok = db.deleteById(parsed.id);
        return { content: [{ type: 'text', text: JSON.stringify({ ok }) }] };
      }
      if (parsed.key) {
        const count = db.deleteByKey(parsed.key);
        return { content: [{ type: 'text', text: JSON.stringify({ deleted: count }) }] };
      }
      return { content: [{ type: 'text', text: JSON.stringify({ error: 'Provide id or key' }) }] };
  • src/mcp.ts:122-132 (registration)
    Tool registration in the tools array, defining name, description, and inputSchema for 'index-delete'.
    {
      name: 'index-delete',
      description: 'Delete notes by id or by key. Returns count/boolean.',
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'number' },
          key: { type: 'string' },
        },
      },
    },
  • Zod schema (DeleteSchema) used for input validation in the index-delete handler.
    export const DeleteSchema = z.object({
      id: z.number().int().positive().optional(),
      key: z.string().optional(),
    });
  • Database helper method deleteById(id) called by the tool handler when deleting by note ID.
    deleteById(id: number) {
      logger.warn({ id }, 'Deleting note by id');
      const info = this.db.prepare(`DELETE FROM notes WHERE id = ?`).run(id);
      return info.changes > 0;
    }
  • Database helper method deleteByKey(key) called by the tool handler when deleting by key.
    deleteByKey(key: string) {
      logger.warn({ key }, 'Deleting notes by key');
      const info = this.db.prepare(`DELETE FROM notes WHERE key = ?`).run(key);
      return info.changes;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the action is 'Delete' and mentions the return value ('Returns count/boolean'), but lacks critical behavioral details such as permissions required, whether deletion is permanent or reversible, rate limits, or error handling for invalid inputs.

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

Conciseness4/5

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

The description is concise with two sentences, front-loading the core action. However, the second sentence about return values could be integrated more smoothly, and some redundancy exists in stating 'by id or by key' without additional context.

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?

Given the complexity of a deletion tool with no annotations, 0% schema coverage, and no output schema, the description is incomplete. It misses essential context like safety warnings, input validation, and detailed return value explanation, making it inadequate for safe and effective use.

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

Parameters2/5

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

Schema description coverage is 0%, and the description only vaguely mentions parameters ('by id or by key') without explaining their semantics, constraints, or usage. It does not compensate for the lack of schema documentation, leaving parameters poorly understood.

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 verb 'Delete' and the resource 'notes', specifying deletion can be by 'id or by key'. However, it does not distinguish this tool from sibling tools like 'image-delete' or 'graph-node-upsert' which might also delete resources, leaving room for sibling differentiation.

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. The description mentions deletion by 'id or by key' but does not specify prerequisites, exclusions, or recommend other tools for related operations, such as using 'index-list-keys' to check keys before deletion.

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/vjsr007/mcp-index-notes'

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