Skip to main content
Glama

list_data_files

Retrieve a list of available data files in the data directory, optionally filtered by file type, to access Old School RuneScape game data and Wiki resources.

Instructions

List available data files in the data directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileTypeNoOptional filter for file type (e.g., 'txt')

Implementation Reference

  • The core handler function that reads the data directory and returns a list of files, optionally filtered by file type extension.
    function listDataFiles(fileType?: string): string[] {
        try {
            const files = fs.readdirSync(DATA_DIR);
            
            if (fileType) {
                return files.filter(file => file.endsWith(`.${fileType}`));
            }
            
            return files;
        } catch (error) {
            console.error("Error listing data files:", error);
            return [];
        }
    }
  • Zod schema defining the optional 'fileType' input parameter for the tool.
    const ListDataFilesSchema = z.object({
        fileType: z.string().optional().describe("Optional filter for file type (e.g., 'txt')")
    });
  • index.ts:334-337 (registration)
    Tool registration in the listTools handler, including name, description, and input schema.
        name: "list_data_files",
        description: "List available data files in the data directory.",
        inputSchema: convertZodToJsonSchema(ListDataFilesSchema),
    },
  • Dispatcher case in the main CallToolRequestSchema handler that parses args and invokes the listDataFiles function.
    case "list_data_files":
        const { fileType } = ListDataFilesSchema.parse(args);
        const files = listDataFiles(fileType);
        return responseToString({ files, path: DATA_DIR });
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 the tool lists files but doesn't specify whether this is a read-only operation, what permissions are required, how results are returned (e.g., pagination, sorting), or potential errors like missing directories. This leaves significant gaps in understanding the tool's behavior beyond basic functionality.

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, clear sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and efficient, making it easy to parse quickly, which aligns well with best practices for conciseness in tool descriptions.

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 list tool with one optional parameter and no output schema, the description is minimally adequate. It covers the basic purpose but lacks details on behavioral aspects like error handling or result format. Without annotations or an output schema, more context on what the tool returns or how it behaves would improve completeness, but it's not entirely inadequate for this level of complexity.

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?

The input schema has 100% description coverage, with the single parameter 'fileType' documented as an optional filter. The description doesn't add any meaning beyond this, such as examples of valid file types or how filtering works. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema adequately handles parameter documentation.

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 action ('List') and resource ('available data files in the data directory'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'search_data_file', which appears to be a more specific search function, leaving some ambiguity about when to choose one over the other.

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 like 'search_data_file' or 'get_file_details'. It lacks context about prerequisites, such as whether the data directory must exist or be accessible, and offers no explicit when-not-to-use scenarios or comparisons with sibling tools.

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/JayArrowz/mcp-osrs'

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