Skip to main content
Glama

add_document

Import local PDF, DOCX, MD, TXT, or Office files into the knowledge base by splitting and ingesting them, with optional project scoping and error responses for missing or unsupported files.

Instructions

导入本地文档(PDF/DOCX/MD/TXT 及 Office 格式)切分入库; 返回 {"source": 文件名, "chunks": 块数};文件不存在或格式不支持时 返回 {"error": "FILE_NOT_FOUND" | "UNSUPPORTED_FORMAT", "message": 原因}。 project:文档 chunk 落入该项目子库(空=全局库);client:仅用于审计归类。 English: Import a local document (PDF/DOCX/MD/TXT and Office formats), split and ingest it; returns {"source": filename, "chunks": count}; when the file is missing or the format is unsupported returns {"error": "FILE_NOT_FOUND" | "UNSUPPORTED_FORMAT", "message": reason}. project: chunks go to that project's sub-store (empty = global); client is audit-only.

Input Schema

NameRequiredDescriptionDefault
pathYes
clientNo
projectNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden; it usefully discloses the return shape (source/chunks) and the two error codes with reasons, which is real behavioral value. However it omits permissions/auth, idempotency, and what happens on re-import or duplicate files.

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

Conciseness3/5

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

Front-loads the operation and return contract, which is good structure. But the entire content is duplicated in Chinese and English, roughly doubling length without adding information, and the parameter notes trail after the return-value block.

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?

With no output schema the description correctly supplies the return and error contract, and with no annotations it covers parameter meaning. It is only missing the safety/permission profile and path-format semantics, so it is close to complete for a 3-parameter ingest tool.

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 0%, so the description must compensate. It does well for project (sub-store target, empty = global) and client (audit-only), but the required `path` parameter is left unqualified – no indication of whether it is a server-side or client-side path or an absolute vs relative path.

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 (import/split/ingest) and resource (local document) plus the supported formats, so it is distinguishable from the sibling add_webpage via the 'local' qualifier. It stops short of naming the sibling explicitly, but the intent is unambiguous.

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 explicit when-to-use or when-not-to-use guidance. It never mentions add_webpage (the obvious alternative for remote content) or any prerequisite/precondition, leaving the agent to infer that this tool is only for local files.

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