Skip to main content
Glama
github-fetcher

github-fetcher

by KurvCygnus

GitHub tree

github_tree
Read-onlyIdempotent

Lists files and directories in a GitHub repository at a branch, tag, or commit, with optional recursive traversal, glob and path-prefix filters, entry limits, and summary-only output.

Instructions

List files and directories in a repository at a ref, using the git trees API. Use recursive=true only when the full tree is needed; a glob containing / or ** implies recursion unless recursive is explicitly false. path_prefix filters entry paths by literal prefix and is applied with glob before max_entries. max_bytes (default 2 MiB, max 16 MiB) clips the raw response locally; local clipping, the entry cap, and GitHub truncation all set truncated while api_truncated stays upstream-only, and a clipped response's hint names max_bytes. summary_only drops entries and returned_entries and answers with total_bytes plus top_dirs totals for the full tree instead; a recursive timeout degrades to one top-level retry with degraded:true and a hint. Returns {ref, path, entries[{path, type, size, sha}], total_entries, returned_entries, summary, truncated, api_truncated}.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "repo": "<repo>"
    },
    "name": "github_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoBranch, tag, or commit; defaults to the repository default branch
globNoFilter returned entries by glob pattern, e.g. **/dev-overlay/** or src/*.ts; filters the entry list only — use github_file_grep to search file contents
pathNoSubdirectory path inside the ref
repoYesRepository in owner/name form
freshNoBypass the local cache
max_bytesNoMaximum raw response bytes to keep, default 2 MiB, max 16 MiB; local clipping sets truncated with a max_bytes hint
recursiveNoReturn the complete tree recursively
max_entriesNoMaximum entries returned, 1-10000, default 1000
path_prefixNoFilter returned entries by a literal path prefix, e.g. docs/
summary_onlyNoOmit entries and return total_bytes plus top_dirs for the full tree instead; max_entries, path_prefix, and glob are ignored; use with recursive: true

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.7.1
    • addedInput schema / properties / max_bytes
      Added value: +{
      +  "description": "Maximum raw response bytes to keep, default 2 MiB, max 16 MiB; local clipping sets truncated with a max_bytes hint",
      +  "maximum": 16777216,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / path_prefix
      Added value: +{
      +  "description": "Filter returned entries by a literal path prefix, e.g. docs/",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / properties / summary_only / description
      Previous value: -"Omit entries and return total_bytes plus top_dirs for the full tree instead; max_entries is ignored; use with recursive: true"New value: +"Omit entries and return total_bytes plus top_dirs for the full tree instead; max_entries, path_prefix, and glob are ignored; use with recursive: true"
  2. Changed1 schema field changedv0.6.0
    • addedInput schema / properties / glob
      Added value: +{
      +  "description": "Filter returned entries by glob pattern, e.g. **/dev-overlay/** or src/*.ts; filters the entry list only — use github_file_grep to search file contents",
      +  "maxLength": 200,
      +  "minLength": 1,
      +  "type": "string"
      +}
  3. Changed1 schema field changedv0.5.0
    • changedInput schema / properties / summary_only / description
      Previous value: -"Omit entries and return total_bytes plus top_dirs for the full tree instead; max_entries is ignored"New value: +"Omit entries and return total_bytes plus top_dirs for the full tree instead; max_entries is ignored; use with recursive: true"
  4. Changed2 schema fields changedv0.3.0
    • changedInput schema / properties / max_entries / description
      Previous value: -"Maximum entries returned, default 1000"New value: +"Maximum entries returned, 1-10000, default 1000"
    • addedInput schema / properties / summary_only
      Added value: +{
      +  "description": "Omit entries and return total_bytes plus top_dirs for the full tree instead; max_entries is ignored",
      +  "type": "boolean"
      +}
  5. Changed1 schema field changedv0.2.1
    • addedInput schema / properties / max_entries
      Added value: +{
      +  "description": "Maximum entries returned, default 1000",
      +  "maximum": 10000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  6. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/openWorld annotations, the description discloses truncation semantics (local clipping vs entry cap vs GitHub truncation all set truncated, api_truncated stays upstream-only), default and maximum byte limits, and a degraded timeout path that retries top-level with degraded:true. These are non-obvious behaviors an agent cannot infer from structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and every sentence carries substantive information rather than restating the schema. It is a dense, run-on paragraph with several clauses chained together, which slightly hurts scanability but wastes little text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter tool with no output schema, the description supplies the return shape ({ref, path, entries[...], total_entries, returned_entries, summary, truncated, api_truncated}), truncation flag distinctions, and the degraded fallback. Nothing critical for correct invocation appears missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real interaction semantics the schema does not: glob/recursive coupling, path_prefix applied with glob before max_entries, and summary_only ignoring max_entries, path_prefix, and glob. That is meaningful ordering and precedence behavior beyond per-parameter docs.

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?

The opening sentence gives a specific verb (List), resource (files and directories), scope (in a repository at a ref) and names the underlying API (git trees API). It further distinguishes itself from content search by pointing to github_file_grep, so an agent can tell it apart from siblings like github_file and github_files.

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?

It gives concrete conditional guidance: use recursive=true only when the full tree is needed, and a glob containing / or ** implies recursion unless recursive is explicitly false. It also states summary_only should be used with recursive: true. It stops short of a full when-to-use/when-not matrix against other listing siblings, but the exclusion of content search is explicit.

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