Skip to main content
Glama

doc_index_repo

Index a GitHub repository's documentation to let AI agents navigate by section, reducing token usage and improving precision. Fetches .md/.txt files, parses sections, and saves to local storage.

Instructions

Index a GitHub repository's documentation. Fetches .md/.txt files, parses sections, and saves to local storage. Embeddings auto-enable when a provider is configured (GOOGLE_API_KEY, OPENAI_API_KEY, openai-compatible + JDOCMUNCH_OPENAI_COMPAT_URL + JDOCMUNCH_OPENAI_COMPAT_MODEL, or sentence-transformers). Indexes .md and .txt only; every other file in the repo is ignored. Returns changes on every success path (at most 50 entries, newest first) with changes_total and changes_truncated beside it; the new/changed/deleted counts are the authority, not len(changes). Each entry's mtime is the head COMMIT date, offset-aware (e.g. 2026-09-20T13:15:39+00:00), because a repository has no per-file modification time. index_local's mtime is naive local time instead, so read the offset before comparing times across the two. v1.147+ — every success response returns duplicate_anchors (empty when none; at most 20 entries, each with section_ids and titles capped at 20 and section_ids_truncated), duplicate_anchors_total (uncapped), duplicate_anchors_truncated and duplicate_anchor_warning for explicit {#id} headings written twice in one document.

Input Schema

NameRequiredDescriptionDefault
refNoOptional GitHub branch, tag, or commit-ish to index. If omitted, HEAD is used. The ref is resolved to a commit SHA before fetching content; repo@sha remains the durable lookup handle.
urlYesGitHub repository URL or owner/repo string
nameNoOptional stored index name override. If omitted, the GitHub repo name is used. Must be a safe storage component: letters, numbers, dot, underscore, and hyphen only.
incrementalNoWhen true (default), skip all HTTP fetches if the selected GitHub ref's commit SHA is unchanged; otherwise only re-index changed files. Set to false to force a full re-index.
use_embeddingsNoGenerate semantic embeddings for each section. true/false/"auto". "auto" (default) enables embeddings when an embedding provider is configured, including openai-compatible + JDOCMUNCH_OPENAI_COMPAT_URL + JDOCMUNCH_OPENAI_COMPAT_MODEL.auto
use_ai_summariesNoUse AI to generate section summaries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.118.0
  2. Removedv1.99.0
  3. Changed3 schema fields changedv1.69.0
    • changedInput schema / properties / incremental / description
      Previous value: -"When true (default), skip all HTTP fetches if the HEAD commit SHA is unchanged; otherwise only re-index changed files. Set to false to force a full re-index."New value: +"When true (default), skip all HTTP fetches if the selected GitHub ref's commit SHA is unchanged; otherwise only re-index changed files. Set to false to force a full re-index."
    • addedInput schema / properties / name
      Added value: +{
      +  "description": "Optional stored index name override. If omitted, the GitHub repo name is used. Must be a safe storage component: letters, numbers, dot, underscore, and hyphen only.",
      +  "type": "string"
      +}
    • addedInput schema / properties / ref
      Added value: +{
      +  "description": "Optional GitHub branch, tag, or commit-ish to index. If omitted, HEAD is used. The ref is resolved to a commit SHA before fetching content; repo@sha remains the durable lookup handle.",
      +  "type": "string"
      +}
  4. First observedv1.66.3

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only supply readOnlyHint=false, so the description carries the rest and does so richly: file-type scope, return-shape guarantees (changes capped at 50, counts are authoritative over len), the commit-date vs naive-local-time distinction, and v1.147+ duplicate_anchors fields with their caps. This is exactly the behavioral context an agent needs for a mutating indexer.

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?

Dense but front-loaded: the purpose sentence leads, followed by the scoping rule, then return-value and versioning detail. Every sentence carries operational information (caps, offsets, authoritative counts) rather than filler.

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?

With no output schema, the description must explain return values and it does so thoroughly (changes, changes_total, duplicate_anchors family, mtime semantics). Coverage of embeddings/incremental/ref prerequisites is adequate for a 6-param mutating tool, though it never states permissions or failure/auth behavior.

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 every parameter is already documented in the schema. The description largely restates embedding-provider and incremental behavior already present there, adding little syntax or format detail beyond the schema baseline.

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?

States a specific verb and resource ('Index a GitHub repository's documentation') and immediately explains the mechanism (fetches .md/.txt, parses sections, saves locally). It is clearly distinguished from the sibling index_local by calling out its differing mtime semantics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete context: embedding auto-enablement conditions, the fact that .md/.txt are indexed and all else ignored, and how index_local differs. However, it never explicitly states when to choose this tool over index_local (e.g. remote URL vs local path), leaving the routing to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.