Skip to main content
Glama

github_list_directory

List files and folders in a GitHub repository directory to inspect project structure and locate code or resources. Provide owner, repo, and optional path or ref.

Instructions

列出仓库中一个目录的内容(只读)。

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": {
      "owner": "<owner>",
      "repo": "<repo>"
    },
    "name": "github_list_directory"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNo
pathNo目录路径,留空为根目录
repoYes仓库名
ownerYes仓库所有者(用户或组织)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full disclosure burden; it does state the operation is read-only, which is the key safety trait. However, it says nothing about what a listing returns (names vs. metadata), how a nonexistent path is handled, or whether results are paginated — gaps that matter for an unannotated, output-schema-less tool.

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?

A single short sentence with zero padding, front-loading the verb and resource. Nothing in it is redundant or wasted.

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

Completeness3/5

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

For a simple four-parameter read tool with no output schema and no annotations, the definition covers the core purpose but leaves the agent guessing about return shape and edge cases. It is minimally adequate rather than complete.

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 75%, so most parameters (path, repo, owner) are already documented in the schema, including that an empty path means the repository root. The description adds no additional meaning about ref semantics or path format beyond what the schema already states, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource — list the contents of a directory inside a repository — which clearly separates it from get-style siblings like github_get_file and github_get_readme. It stops short of naming any sibling explicitly, so the differentiation is implied rather than stated.

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

Usage Guidelines2/5

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

There is no guidance on when to choose this tool over github_get_file, github_get_readme, or github_search_code, and no prerequisites or exclusions are given. The only usage-adjacent signal is the '(read-only)' tag, which is a safety note rather than a routing rule.

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