Skip to main content
Glama

Compile Documents

compile_documents
Read-onlyIdempotent

Combine binder documents into a single manuscript in text, markdown, or HTML. Use standard mode for binder-order compilation or intelligent mode with AI optimization for specific targets.

Instructions

Compile the project's documents into a single continuous manuscript in the requested format and return the compiled text (large results are spooled to a file reference). In "standard" mode it joins documents in binder order; in "intelligent" mode it uses AI to optimize the output for a specific target such as an agent query or synopsis. To write a manuscript to disk in a publishing format (EPUB, etc.) use export_project instead. Requires an open project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo"standard" (default) joins documents in order; "intelligent" applies AI optimization toward targetOptimization.
formatNoOutput format of the compiled manuscript. Default "text".
separatorNoText inserted between documents in the standard-mode fallback. Default "\n\n---\n\n".
documentIdsNoOptional explicit list of document ids to compile, in order. Overrides rootFolderId when provided; most useful with mode "intelligent".
hierarchicalNoPreserve the binder folder hierarchy as headings. Default false.
includeNotesNoInclude each document's notes in the output. Default false.
rootFolderIdNoOptional binder folder id to compile only its descendants. Omit to compile all text documents.
includeSynopsisNoInclude each document's synopsis in the output. Default false.
targetOptimizationNoFor mode "intelligent": what to optimize the compiled output for. Default "general".
Behavior4/5

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

Annotations already indicate read-only and idempotent. Description adds key behavioral info: large results are spooled to a file reference, and it requires an open project. No contradiction with annotations.

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?

Three sentences: first sentence states main action and spooling behavior, second explains modes, third gives sibling comparison and prerequisite. Front-loaded, no fluff, every sentence earns its place.

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?

Tool has 9 optional parameters (no required), no output schema, but schema descriptions are complete. Description covers main behavior, spooling, modes, prerequisite, and sibling. Missing detail on exact return value structure, but generally sufficient for use.

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 100%, so description doesn't need to explain each parameter. However, it adds context by describing what 'standard' and 'intelligent' modes do, which aligns with the 'mode' parameter. No extra value beyond schema for other parameters.

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?

Clearly states the tool compiles project documents into a continuous manuscript in a requested format (verb+resource+output). Distinguishes from sibling 'export_project' by noting that write-to-disk publishing is handled elsewhere.

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?

Explicitly describes when to use this tool (compile documents) and when to use the sibling 'export_project' (write to disk). Also explains the two modes ('standard' vs 'intelligent') and their appropriate use cases.

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/writerslogic/scrivener-mcp'

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