Skip to main content
Glama
eva-wanxin-git

Windows Automation MCP Server

delete_file

Remove files or directories from the Windows system to manage storage and organize data efficiently.

Instructions

删除文件或目录

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes文件或目录路径

Implementation Reference

  • The handler function that executes the delete_file tool: determines if the path is a file or directory and deletes it using fs.unlink or fs.rm with error handling.
    async deleteFile(filePath) {
      try {
        const stats = await fs.stat(filePath);
        if (stats.isDirectory()) {
          await fs.rm(filePath, { recursive: true, force: true });
        } else {
          await fs.unlink(filePath);
        }
        return { success: true, path: filePath, message: '删除成功' };
      } catch (error) {
        return { success: false, error: error.message };
      }
    }
  • Schema definition for the delete_file tool, specifying the input as an object with required 'path' string.
    {
      name: 'delete_file',
      description: '删除文件或目录',
      inputSchema: {
        type: 'object',
        properties: {
          path: { type: 'string', description: '文件或目录路径' },
        },
        required: ['path'],
      },
    },
  • Registration of delete_file handler in the executeTool method's switch statement.
    case 'delete_file':
      return await this.deleteFile(args.path);
  • Includes 'delete_file' in the array of supported tool names checked by canHandle.
    'delete_file', 'copy_file', 'move_file', 'search_files'];
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 action ('删除文件或目录') but lacks critical details: whether deletion is permanent or reversible, if it requires specific permissions, what happens with non-empty directories, or error handling. This is a significant gap for a destructive operation.

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 waste. It is front-loaded and appropriately sized for a simple tool, earning full marks for conciseness.

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 complexity of a destructive operation with no annotations and no output schema, the description is incomplete. It fails to address key aspects like return values, error conditions, or safety warnings, leaving significant gaps for an AI agent to understand the tool's behavior fully.

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 schema description coverage is 100%, with the parameter 'path' documented as '文件或目录路径' (file or directory path). The description adds no additional meaning beyond what the schema provides, such as path format examples or constraints, so it meets the baseline for high coverage.

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 ('删除' meaning delete) and resource ('文件或目录' meaning file or directory), making the purpose unambiguous. It doesn't explicitly distinguish from sibling tools like 'copy_file' or 'move_file', but the action is distinct enough to infer differentiation.

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?

No guidance is provided on when to use this tool versus alternatives like 'copy_file' or 'move_file', nor does it mention prerequisites such as file existence or permissions. The description only states what it does, not when or why to use it.

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/eva-wanxin-git/windows-automation-mcp'

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