Skip to main content
Glama
igordev96
by igordev96

List a directory at a ref

list_tree
Read-only

List files and subdirectories in a GitLab repository at a branch, tag, or commit without checking out code. Enable recursive mode to walk the full subtree and see file sizes.

Instructions

List the files and subdirectories at a given ref, one level deep by default; set recursive to walk the whole subtree. Files carry their size in bytes, so you can tell a small config from a bundle before reading it. Names are full paths relative to the repository root. Give either url — a GitLab tree link — or ref (and optionally path). Everything comes from git, so no file is fetched to answer this. If the copy cannot be refreshed, the cached copy answers and the result says the refresh failed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoBranch, tag, or commit SHA, e.g. 'develop' or 'fix/PROJ-7608'. Required unless `url` is given.
urlNoA GitLab tree link, e.g. 'https://gitlab.example.com/group/repo/-/tree/develop/src'. Replaces ref, path and (usually) project; the host must be GITLAB_HOST.
pathNoDirectory inside the repository, forward slashes, e.g. 'src'. Defaults to the repository root.
projectNoGitLab project path, e.g. 'group/subgroup/repo'. Defaults to GITLAB_DEFAULT_PROJECT, or to the URL's project.
recursiveNoList every file in the subtree instead of just the immediate children (files only).
max_entriesNoMaximum entries to return (default 200).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.10.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint=false, so the safety profile is covered. The description adds real behavioral context beyond that: everything is answered from git with no file fetched, and a stale-cache fallback where the result flags a failed refresh. This is genuinely useful operational detail.

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?

Front-loaded with the core action and default depth, then parameter selection, then behavior. Every sentence carries information; the length is justified by the six parameters and caching nuance, though it is denser than strictly necessary.

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 carries the return-value burden, and it does explain that results carry sizes and repo-root-relative full paths. Ordering and pagination behavior beyond the max_entries default are not covered, leaving a minor gap for a listing tool.

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. The description goes further by clarifying relationships the schema does not: url replaces ref/path/project, names are full paths relative to repo root, and size is in bytes. That adds meaning beyond the per-field descriptions.

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 description uses a specific verb (list) on a specific resource (files and subdirectories at a ref) and states scope precisely: 'one level deep by default; set recursive to walk the whole subtree.' This clearly separates it from read-oriented siblings like get_file and log without needing to name them.

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 selection guidance: use url OR ref (plus optional path), and use recursive only when you want the whole subtree. The remark that sizes let you 'tell a small config from a bundle before reading it' implies using this before get_file. It stops short of explicit when-not or naming alternative siblings.

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