Skip to main content
Glama

available-files

Lists available files and resources in the Hugging Face Spaces environment, helping users identify specific items like recent images or audio files by displaying their URIs, names, sizes, and metadata.

Instructions

A list of available file and resources. If the User requests things like 'most recent image' or 'the audio' use this tool to identify the intended resource.This tool returns 'resource uri', 'name', 'size', 'last modified' and 'mime type' in a markdown table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler logic for the 'available-files' tool call. Returns a markdown-formatted resource table generated by WorkingDirectory.generateResourceTable().
    if (AVAILABLE_FILES === request.params.name) {
      return {
        content: [
          {
            type: `resource`,
            resource: {
              uri: `/available-files`,
              mimeType: `text/markdown`,
              text: await workingDir.generateResourceTable(),
            },
          },
        ],
      };
    }
  • src/index.ts:78-92 (registration)
    Registration of the 'available-files' tool in the ListTools response, including name, description, and empty input schema.
    {
      name: AVAILABLE_FILES,
      description:
        "A list of available file and resources. " +
        "If the User requests things like 'most recent image' or 'the audio' use " +
        "this tool to identify the intended resource." +
        "This tool returns 'resource uri', 'name', 'size', 'last modified'  and 'mime type' in a markdown table",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
    ...Array.from(endpoints.values()).map((endpoint) =>
      endpoint.toolDefinition(),
    ),
  • Helper method in WorkingDirectory class that generates the markdown table listing all available files/resources with URI, name, MIME type, size, and last modified date.
      async generateResourceTable(): Promise<string> {
        const files = await this.listFiles();
        const resources = await Promise.all(
          files
            .filter((entry) => entry.isFile())
            .map(async (entry) => await this.getResourceFile(entry)),
        );
    
        if (resources.length === 0) {
          return "No resources available.";
        }
    
        return `
    The following resources are available for tool calls:
    | Resource URI | Name | MIME Type | Size | Last Modified |
    |--------------|------|-----------|------|---------------|
    ${resources
      .map(
        (f) =>
          `| ${f.uri} | ${f.name} | ${f.mimeType} | ${this.formatFileSize(f.size)} | ${f.lastModified.toISOString()} |`,
      )
      .join("\n")}
    
    Prefer using the Resource URI for tool parameters which require a file input. URLs are also accepted.`.trim();
      }
  • Input schema for the 'available-files' tool: an empty object (no parameters).
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the return format (markdown table with specific fields) which is valuable, but doesn't mention important behavioral aspects like whether this lists all files or has pagination, if it requires authentication, or any rate limits. It adds some context but leaves gaps.

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?

The description is efficiently structured in two sentences: the first states the purpose and usage context, the second specifies the return format. Every sentence adds value with no redundant information, making it appropriately sized and front-loaded.

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?

Given the tool's simplicity (0 parameters, no annotations, no output schema), the description provides sufficient context about what the tool does, when to use it, and what it returns. However, it could be more complete by explicitly differentiating from sibling tools and mentioning any behavioral constraints like access limitations.

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?

The tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the lack of parameters. The description appropriately doesn't add parameter information beyond what's in the schema, maintaining focus on the tool's purpose and output. This meets the baseline expectation for a zero-parameter tool.

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 clearly states the tool's purpose: listing available files and resources with specific attributes. It uses the verb 'returns' and specifies the resource type ('files and resources'), but doesn't explicitly differentiate from sibling tools like 'search-spaces' which might have overlapping functionality.

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 description provides clear guidance on when to use this tool: when the user requests specific resources like 'most recent image' or 'the audio'. However, it doesn't explicitly state when NOT to use it or mention alternatives among the sibling tools, leaving some ambiguity about tool selection.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xiyuefox/mcp-hfspace'

If you have feedback or need assistance with the MCP directory API, please join our Discord server