Skip to main content
Glama
MCP Server RAG

MCP Server RAG

by atengk

rag_delete_document

Deletes a specific document and all its chunks and vector indexes from a knowledge base, matching by document ID, title, or file path.

Instructions

从指定知识库中物理删除特定文档及其所有切片与向量索引。

支持按文档 ID、标题或文件路径精确匹配。

Args:
    kb_name: 目标知识库名称
    doc_id: 待删除的文档 ID、标题或文件路径

Returns:
    dict[str, Any]: 删除操作结果状态字典

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": {
      "kb_name": "<kb_name>",
      "doc_id": "<doc_id>"
    },
    "name": "rag_delete_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
doc_idYes
kb_nameYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden, and it does disclose the key trait that this is a physical, irreversible delete that also removes chunks and vector indexes. It omits other operationally relevant behavior: required permissions, whether a confirmation step exists, and what happens when no document matches the given identifier.

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 destructive scope is front-loaded in the first sentence, the matching modes follow, and the Args block is terse. The Returns line is mildly redundant given an output schema exists, but it costs one short sentence and does not obscure anything.

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

Completeness4/5

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

For a two-parameter destructive tool with an output schema already covering return values, the description supplies purpose, destruction scope, and parameter meaning. The remaining gap is edge-case behavior such as not-found handling or error semantics, which an agent would want before calling an irreversible delete.

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 compensate, and it does: kb_name is identified as the target knowledge base and doc_id is documented as a polymorphic identifier accepting document ID, title, or file path, with exact matching. That adds real meaning the bare string schema does not convey, though it does not specify matching precedence when a title and path collide.

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?

States a specific verb and resource ('物理删除特定文档及其所有切片与向量索引') scoped to one document within a named knowledge base, which implicitly separates it from whole-KB operations. It does not explicitly name rag_delete_kb or rag_clear_kb as the alternatives, so the sibling differentiation is left to inference.

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

Usage Guidelines3/5

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

The scope ('特定文档' inside '指定知识库') implies when this tool applies rather than stating it, and there is no explicit exclusion such as 'use rag_delete_kb to remove an entire knowledge base'. No prerequisite or caution guidance is given, though the destructive intent is clear.

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