Skip to main content
Glama

list_output_files

Retrieve saved audio files and associated metadata from the output directory for organized access and management of text-to-speech synthesis results.

Instructions

List saved audio files in the output directory with metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function in AdvancedTTSServer class that executes the tool logic: reads the output directory, filters for supported audio formats (wav, mp3, flac, ogg), retrieves file stats, and returns sorted list with metadata.
    async listOutputFiles() {
      try {
        const files = await fs.readdir(this.outputDir);
        const audioFiles = files.filter(file => 
          AudioFormats.some(format => file.endsWith(`.${format}`))
        );
    
        const fileInfo = await Promise.all(
          audioFiles.map(async (file) => {
            const filePath = join(this.outputDir, file);
            const stats = await fs.stat(filePath);
            return {
              filename: file,
              path: filePath,
              size: stats.size,
              created: stats.birthtime.toISOString(),
              modified: stats.mtime.toISOString(),
              format: file.split('.').pop()
            };
          })
        );
    
        return {
          success: true,
          files: fileInfo.sort((a, b) => 
            new Date(b.modified).getTime() - new Date(a.modified).getTime()
          ),
          totalFiles: fileInfo.length,
          outputDirectory: this.outputDir
        };
      } catch (error) {
        return {
          success: false,
          error: `Failed to list files: ${error}`
        };
      }
    }
  • Registers the 'list_output_files' tool in the server's listTools response, including name, description, and input schema (no required parameters).
      name: 'list_output_files',
      description: 'List saved audio files in the output directory with metadata',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Defines the input schema for the tool: an empty object since no parameters are required.
      type: 'object',
      properties: {},
    },
  • MCP server request handler that calls the listOutputFiles method and formats the response content for the tool call, including error handling and rich text formatting.
    case 'list_output_files':
      const fileList = await ttsServer.listOutputFiles();
      if (fileList.success) {
        const files = fileList.files?.map(f => 
          `**${f.filename}** (${(f.size / 1024).toFixed(1)}KB) - ${f.format?.toUpperCase()}`
        ).join('\n');
        
        return {
          content: [
            {
              type: 'text',
              text: `🎙️ **Output Files (${fileList.totalFiles})**\n\n` +
                   `**Directory:** ${fileList.outputDirectory}\n\n` +
                   `${files || 'No audio files found'}`,
            },
          ],
        };
      } else {
        return {
          content: [
            {
              type: 'text',
              text: `❌ **Error:** ${fileList.error}`,
            },
          ],
        };
      }
Behavior2/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 states what the tool does but does not disclose any behavioral traits such as whether it requires specific permissions, how it handles errors, if it has rate limits, or what the output format looks like. This is a significant gap for a tool with zero annotation coverage.

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 a single, well-structured sentence that directly states the tool's purpose without any waste. It is front-loaded with the core action and resource, making it highly concise and easy to parse, earning its place with no extraneous information.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It does not explain what metadata is included, how files are sorted or filtered, or what the return values look like. For a tool that lists files with metadata, more context is needed to fully understand its behavior and output, making it inadequate for the complexity involved.

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, and schema description coverage is 100%, so there are no parameters to document. The description does not need to add parameter semantics beyond the schema, and it appropriately avoids unnecessary details. A baseline of 4 is applied as it handles the zero-parameter case efficiently without redundancy.

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 verb ('List') and resource ('saved audio files in the output directory with metadata'), making the purpose specific and understandable. However, it does not explicitly differentiate from sibling tools like 'get_status' or 'get_voices', which might also involve listing or retrieving information, so it misses full sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives. It does not mention any context, prerequisites, or exclusions, such as when to prefer 'list_output_files' over 'get_status' for checking file availability or other sibling tools. This lack of usage context leaves the agent without clear direction.

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

Related 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/samihalawa/advanced-tts-mcp'

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