Skip to main content
Glama

List Model Files

list_model_files
Read-onlyIdempotent

Hugging Face Hub API, list the files in a model repository at a given revision (branch, tag or commit; main by default) and optional subdirectory path. Returns each entry's path, type, byte size and blob SHA, including LFS details for weight shards. Answers which weight, config and tokenizer files ship in a Hugging Face model repo and how large they are.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "repo_id": "bert-base-uncased"
    },
    "name": "list_model_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoSubdirectory (default root)
repo_idYes
revisionNoBranch/commit/tag (default main)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "repo_id": "bert-base-uncased"
      +  },
      +  {
      +    "path": "config",
      +    "repo_id": "meta-llama/Llama-2-7b"
      +  }
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "List of files in a model repository",
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and open-world, so the safety profile is covered. The description adds useful defaults (main revision, root path) and the LFS-detail behavior for weight shards, but says nothing about pagination limits on large repos or auth requirements for gated/private repositories.

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?

Two sentences, front-loaded with the operation and scope, then the returned fields and the motivating question. The field enumeration slightly overlaps the output schema, but it earns its place by naming the LFS detail that matters for weight shards.

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 an output schema present and annotations covering safety, the description needn't explain return values and doesn't. The remaining gap is operational: no mention of pagination/truncation on large repos or token requirements for gated models, which an agent needs to interpret results correctly.

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 67% and the uncovered parameter is repo_id, which the description implies via 'model repository' and the schema's own examples clarify. The description adds semantics beyond the schema for revision ('branch, tag or commit; main by default') and confirms path is an optional subdirectory.

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 ('list the files in a model repository') plus the scoping dimensions (revision, subdirectory), and the closing sentence names the concrete question it answers. The 'model repository' framing implicitly separates it from the dataset-oriented sibling without needing to name it.

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?

The final sentence gives a clear use case: determining which weight, config and tokenizer files ship in a repo and their sizes. It does not state when NOT to use it (e.g. use huggingface_get_model for repo metadata rather than file listings), so it falls short of explicit alternatives.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.