Skip to content
Back to skills

Document Graph Tools

ASecurity

Reference for the Document Graph navigation tools (get_folder_toc, get_document_toc, get_section_content, search_sections, list_documents) and the Ladybug schema they traverse. Use to look up exact tool arguments, return shapes, and the Folder/Document/MarkdownSection node model when navigating a document corpus.

  • 4 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 9, 2026
databasesnodedatabase

Security analysis

A100/100

Scanned November 9, 2026

npx -y skills add tclatos/genai-graph --skill document-graph-tools --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Document Graph Tools?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Document Graph Tools
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tclatos-document-graph-tools/badge)](https://www.skillsdirectory.com/skills/tclatos-document-graph-tools)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: document-graph-tools
description: Reference for the Document Graph navigation tools (get_folder_toc, get_document_toc, get_section_content, search_sections, list_documents) and the Ladybug schema they traverse. Use to look up exact tool arguments, return shapes, and the Folder/Document/MarkdownSection node model when navigating a document corpus.
---

# Document Graph Tools Reference

## Schema

```
Folder ──CONTAINS──▶ Document ──HAS_SECTION──▶ MarkdownSection ──HAS_SUBSECTION──▶ MarkdownSection ──…
                                                      │
                                                      └──HAS_CHUNK──▶ SectionChunk (vector index)
```

- **Folder** — a source location (directory, zip, or dataset bucket). Key `folder_id`.
- **Document** — a source file, keyed by `content_hash` (xxHash of bytes); carries `filename`,
  `token_count`, `section_count`, routing `description`, and `summary`.
- **MarkdownSection** — one heading-delimited section, keyed by `section_id = "{content_hash}::{sequence}"`.
  Carries `title`, `level`, `text` (raw markdown of the section excluding subsections), `token_count`,
  `sequence`, `description`, `summary`, `keywords`, and `parent_section_id`.
- **SectionChunk** — text chunk for long sections, keyed by `chunk_id = "{section_id}::{chunk_index}"`.
  Indexed by HNSW vector embeddings for semantic search.

---

## Tools Reference

### `get_folder_toc(folder_id: str | None = None) -> str`
List documents in a folder as YAML:
- Returns each document's `id` (`content_hash`), `name` (filename), `sections` count, and one-line `description`.
- When `folder_id` is omitted, lists all documents in the corpus.
- Does not list individual sections — call `get_document_toc` on selected documents.

### `get_document_toc(document_id: str, include_summaries: bool = False, max_level: int | None = None) -> str`
Returns the hierarchical section outline of a single document as YAML:
- `document_id`: accepts content hash (full or prefix), filename, or path.
- `max_level`: restricts depth (e.g. `max_level=2` for top-level headers only).
- `include_summaries`: when `True`, includes synthesized section descriptions/summaries and table metrics.
- Output contains each section's `id` (`{content_hash}::{sequence}`), `title`, `level`, and `description`.

### `get_section_content(section_ids: str, start_line: int | None = None, max_lines: int | None = None) -> str`
Retrieves raw Markdown body text for specified section IDs:
- `section_ids`: comma-separated string of section IDs (e.g. `"568acd8b::3,568acd8b::4"`).
- `start_line` (optional, 1-based): starting line offset within the section markdown.
- `max_lines` (optional): maximum number of lines to return.
- Essential for paginating tall/wide financial and statistical tables without context overflow.

### `search_sections(query: str, limit: int = 20, folder_id: str | None = None, document_id: str | None = None, mode: str = "hybrid") -> str`
Performs ranked search across section titles, chunk embeddings, keywords, and markdown text:
- `query`: natural language phrase or keyword search query.
- `document_id`: restrict search to a single document (eliminates cross-document noise).
- `folder_id`: restrict search to a specific folder.
- `limit`: maximum number of matching sections to return (default 20).
- `mode`: `"hybrid"` (fuses vector similarity + BM25 keyword search via RRF), `"vector"`, `"bm25"`, or `"cypher"`.
- Returns matching sections ranked best-first with `section_id`, `title`, `score`, `level`, and matching snippet.

### `query_image(image: str, question: str, model: str | None = None) -> str`
Analyze an image using a Vision-Language Model (VLM) to answer visual questions:
- `image`: Image filename (e.g. `'7a8b9c0d.png'`), image hash/name, or local file path found in section markdown comments (e.g. `<!-- Image: {hash}.png -->`).
- `question`: specific question about the image (e.g. `'What is the percentage shown for 2015 in Figure 1?'`).
- `model`: optional VLM model ID (defaults to `'glm_5.3_flash@openrouter'`).
- Note: Max 3 visual image queries are allowed per question. Returns the VLM's visual analysis and answer based on the actual image pixels.

### `list_documents() -> str`
Lists all documents in the corpus with their content hash, filename, section count, and routing description. Equivalent to calling `get_folder_toc()` with no folder.

---

## Idempotence & Schema Tolerance

Tools tolerate partially-ingested or older databases: they omit fields absent in the schema and return clean "No ... found" indicators rather than raising exceptions.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in databases →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.