Skip to main content
Glama

docshelf_add_document

Idempotent

Add PDF or Markdown files to a categorized document shelf. PDFs are converted to Markdown and large documents split by headings, with automatic index regeneration.

Instructions

Add a PDF or Markdown file to the shelf and refresh INDEX.md.

  • .pdf is converted to Markdown (pymupdf4llm by default; pass quality='high' to use marker-pdf).

  • Documents larger than 50 KB with multiple H2 headings are split into one file per section (turn this off with split=False).

  • If a different title/category slugifies onto a path an existing document already occupies, the call errors instead of overwriting it — pass overwrite=true to replace it. Re-adding the same title updates in place. The response reports overwritten.

  • The response warnings include suspicious section headings and an empty-conversion warning when the source yields little or no text (e.g. a scanned / image-only PDF — consider quality='high' / OCR).

  • INDEX.md is regenerated automatically. The caller still owns the git commit / push step.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The description discloses behaviors such as PDF-to-Markdown conversion, automatic splitting of large documents, slug collision handling with overwrite flag, regeneration of INDEX.md, and warnings for suspicious sections. This goes well beyond the annotations (idempotentHint, destructiveHint) by explaining exactly what happens under various conditions.

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 well-structured with a lead sentence and bullet points. It is informative but somewhat lengthy; however, every sentence adds value. The information could be condensed without loss, but it is not overly verbose.

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 the tool's complexity (multiple parameters, conversion, splitting, collision handling), the description covers most important aspects: conversion options, splitting criteria, overwrite behavior, warnings, and INDEX.md regeneration. However, it only mentions 'PDF or Markdown file' at the start, while the input schema supports additional formats (DOCX, HTML, EPUB) – this omission could mislead users.

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

Parameters5/5

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

The description adds significant meaning beyond the input schema's property descriptions. For example, it explains the effect of split (based on size and H2 headings), the quality options with 'fast' and 'high' alternatives, and the overwrite behavior with error vs replacement. It also clarifies the slug parameter's purpose and the file formats supported (though schema lists more).

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 starts with 'Add a PDF or Markdown file to the shelf and refresh INDEX.md' which clearly states the action (add) and resource (shelf). It distinguishes from sibling tools like docshelf_add_directory by focusing on a single file, and from docshelf_remove_document by the operation type.

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 description provides details on parameters (split, overwrite, quality) but does not explicitly guide when to use this tool versus alternatives like docshelf_add_directory or docshelf_rename_document. It implicitly states use for adding a single file, but lacks explicit exclusions or comparisons.

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/ignatenkofi/docshelf-mcp'

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