Skip to main content
Glama
WaterSippin

OSRS MCP Server

Official
by WaterSippin

list_data_files

Retrieve and filter available data files in the OSRS MCP Server directory by specifying a file type.

Instructions

List available data files in the data directory.

Input Schema

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

Implementation Reference

  • Core handler function that lists files in the data directory, optionally filtering by file type extension.
    async function listDataFiles(fileType?: string): Promise<string[]> {
        try {
            const files = await fs.promises.readdir(getDataDir());
            
            if (fileType) {
                return files.filter(file => file.endsWith(`.${fileType}`));
            }
            
            return files;
        } catch (error) {
            console.error("Error listing data files:", error);
            return [];
        }
    }
  • Zod input schema defining the optional fileType parameter for the tool.
    const ListDataFilesSchema = z.object({
        fileType: z.string().optional().describe("Optional filter for file type (e.g., 'txt')")
    });
  • index.ts:374-376 (registration)
    Tool definition registration in the getToolDefinitions() function used for tool discovery.
        name: "list_data_files",
        description: "List available data files in the data directory.",
    },
  • Tool dispatch handler in the main CallToolRequest switch that validates arguments and invokes the listDataFiles function.
    case "list_data_files":
        const listFilesArgs = getSchemaForTool(name).parse(args) as { fileType?: string };
        const { fileType } = listFilesArgs;
        const files = await listDataFiles(fileType);
        return responseToString({ files, path: getDataDir() });
  • Schema retrieval case in getSchemaForTool() that returns the tool's input schema for validation.
    case "list_data_files":
        return ListDataFilesSchema;
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 this is a list operation but doesn't describe what 'available' means (e.g., permission-based, all files), whether it's paginated, what format the output takes, or any rate limits. For a tool with zero annotation coverage, this leaves significant behavioral 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 a single, efficient sentence with zero wasted words. It's appropriately sized for a simple list tool and front-loads the core purpose immediately.

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?

Given the tool's low complexity (1 optional parameter, no output schema, no annotations), the description is minimally complete but lacks depth. It covers the basic purpose but doesn't address behavioral aspects like output format or usage context relative to siblings, leaving room for improvement despite the simple structure.

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 100%, so the schema already documents the single optional 'fileType' parameter with its purpose. The description doesn't add any parameter-specific information beyond what the schema provides, maintaining the baseline score of 3 for adequate but no extra value.

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'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'search_data_file', which appears to be a related search function.

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 mentions a data directory context but offers no explicit when/when-not instructions or prerequisites for usage.

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

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