Skip to content

feat: add paginated reading, string-match editing, document cache, an…#105

Open
Vortiago wants to merge 3 commits intomainfrom
work/trusting-davinci
Open

feat: add paginated reading, string-match editing, document cache, an…#105
Vortiago wants to merge 3 commits intomainfrom
work/trusting-davinci

Conversation

@Vortiago
Copy link
Copy Markdown
Owner

@Vortiago Vortiago commented Apr 6, 2026

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.

Vortiago added 3 commits April 6, 2026 11:49
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant