feat: add paginated reading, string-match editing, document cache, an…#105
Open
feat: add paginated reading, string-match editing, document cache, an…#105
Conversation
…d server instructions Add five new capabilities to reduce token usage and API calls when working with large Outline documents: - Paginated reading: read_document now accepts offset/limit parameters for line-range access. Default behavior (full read) is unchanged for backward compatibility. - Document navigation: new get_document_toc and read_document_section tools for heading-based navigation. TOC returns heading structure with line numbers; section reading uses case-insensitive substring matching. - String-match editing: new edit_document tool with batched old_string/ new_string replacements applied server-side. Supports staging via save=False across multiple calls, then save_document to push once. - Document cache: in-memory LRU cache with configurable TTL reduces API calls. Supports dirty tracking for staged edits. Cache eviction on writes is cross-tenant (all API keys for the same document). - Server instructions: MCP instructions field guides LLMs on tool selection, workflows, and Outline-specific conventions (mermaidjs fences). Also improves tool parameter schemas by using Pydantic models (DocumentEdit, BatchUpdateItem, BatchCreateItem) instead of Dict[str, Any], so field names and descriptions appear in the JSON schema for better LLM tool usage. Updates the outline-explorer agent to use TOC and section reading for more efficient large-document exploration.
Simplifies the editing API surface by removing the separate save_document tool. The staged workflow now uses save=True on the final edit_document call to push all accumulated changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add five new capabilities to reduce token usage and API calls when working with large Outline documents:
Paginated reading: read_document now accepts offset/limit parameters for line-range access. Default behavior (full read) is unchanged for backward compatibility.
Document navigation: new get_document_toc and read_document_section tools for heading-based navigation. TOC returns heading structure with line numbers; section reading uses case-insensitive substring matching.
String-match editing: new edit_document tool with batched old_string/ new_string replacements applied server-side. Supports staging via save=False across multiple calls, then save_document to push once.
Document cache: in-memory LRU cache with configurable TTL reduces API calls. Supports dirty tracking for staged edits. Cache eviction on writes is cross-tenant (all API keys for the same document).
Server instructions: MCP instructions field guides LLMs on tool selection, workflows, and Outline-specific conventions (mermaidjs fences).
Also improves tool parameter schemas by using Pydantic models (DocumentEdit, BatchUpdateItem, BatchCreateItem) instead of Dict[str, Any], so field names and descriptions appear in the JSON schema for better LLM tool usage.
Updates the outline-explorer agent to use TOC and section reading for more efficient large-document exploration.