Skip to main content
Glama

remove_document

Remove a document from the knowledge base index while keeping the file on disk, or set delete_file to permanently delete it.

Instructions

Remove a document from the knowledge base index.

Mutating — removes index entries. If delete_file=True, also permanently deletes the file from disk (irreversible, cannot be undone).

Args: filepath: Path to the document file. Must be an indexed document — list_documents() lists indexed paths, one page at a time. delete_file: If True, permanently deletes the file from disk in addition to removing from the index (default: False).

Returns: JSON string with removal results (filepath, status).

Usage: Use to unindex a document while keeping the file on disk (default). Set delete_file=True only for permanent removal. Use update_document() to replace content instead of removing. Use reindex_documents(force=True) if you deleted the file manually on disk outside of this tool.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "filepath": "<filepath>"
    },
    "name": "remove_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
filepathYes
delete_fileNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden and does most of it: it declares the operation mutating, warns the delete_file path is irreversible and cannot be undone, and specifies the safe default. It omits error behavior — e.g., what happens if filepath is not currently indexed — and any permission requirements, which keeps it short of a 5.

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?

Front-loaded with the one-line purpose, then Args/Returns/Usage in a predictable order that scans well. Slight redundancy: the permanent-deletion warning is repeated three times (parenthetical in the lead, Args entry, and Usage sentence), which could be tightened without losing information.

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

Completeness5/5

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

For a two-parameter destructive-adjacent tool this covers everything needed to invoke it correctly: scope of removal, the irreversible flag, default behavior, discovery of valid paths, sibling alternatives, and recovery path via reindex. An output schema exists, so the brief Returns line is sufficient rather than required.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must supply all parameter meaning, and it does: filepath must reference an already-indexed document and list_documents() is offered as the discovery path, while delete_file's default and irreversible consequence are spelled out. The only gap is path format (relative vs absolute) and any expected extension conventions.

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

Purpose5/5

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

States a specific verb and resource — 'Remove a document from the knowledge base index' — and immediately narrows scope by clarifying that index removal is distinct from on-disk deletion. An agent can separate it from add_document and update_document without opening any schema.

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

Usage Guidelines5/5

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

The Usage block gives explicit when-to-use ('unindex a document while keeping the file on disk'), when-not ('Set delete_file=True only for permanent removal'), and names two alternatives with their selecting conditions (update_document to replace content, reindex_documents(force=True) after manual deletion). This is textbook routing guidance.

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