Skip to main content
Glama

add_document

Add documents to a local knowledge base by providing content, filepath, and category. Saves and indexes content immediately for retrieval.

Instructions

Add a new document to the knowledge base from raw content.

Saves the content to the documents directory and indexes it immediately.

Args:
    content: Full text content of the document
    filepath: Relative path within documents dir (e.g., "security/new-technique.md")
    category: Document category (security, ctf, logscale, development, general)

Returns:
    JSON string with indexing results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
filepathYes
categoryNogeneral

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses key behaviors: 'Saves the content to the documents directory' (persistence) and 'indexes it immediately' (immediate indexing). However, it doesn't mention permissions needed, error conditions, or what happens if a document already exists at the filepath.

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 efficiently structured with a purpose statement, behavioral details, and parameter explanations in bullet points. Every sentence adds value with no redundant information, making it easy to parse.

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?

Given no annotations but an output schema exists (returns 'JSON string with indexing results'), the description is reasonably complete. It covers purpose, behavior, and parameters well. However, for a mutation tool, it could better address error handling or idempotency concerns.

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. It provides clear semantics for all three parameters: 'content' as 'Full text content', 'filepath' as 'Relative path within documents dir' with an example, and 'category' as 'Document category' with enumerated values. This adds substantial meaning beyond the bare schema.

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?

The description clearly states the verb 'Add' and resource 'document to the knowledge base', specifying it's from 'raw content'. It distinguishes from siblings like 'add_from_url' (which adds from URL) and 'update_document' (which modifies existing documents).

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

Usage Guidelines4/5

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

The description implies usage context by mentioning 'from raw content' and 'indexes it immediately', suggesting this is for creating new documents from text. However, it doesn't explicitly state when to use alternatives like 'add_from_url' (for URL-based content) or 'update_document' (for modifications).

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/lyonzin/knowledge-rag'

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