Skip to main content
Glama

rm

Delete files or directories from virtual filesystem workspaces. Specify a path and optional recursive flag to remove content.

Instructions

Remove file or directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
recursiveNo

Implementation Reference

  • Main implementation of the 'rm' tool handler in VFSTools class, handling path resolution, validation, and delegation to VFS rm/rmdir methods.
    async def rm(self, path: str, recursive: bool = False) -> RemoveResponse:
        """
        Remove file or directory.
    
        Args:
            path: Path to remove
            recursive: If True, remove directories recursively
    
        Returns:
            RemoveResponse with success status
        """
        vfs = self.workspace_manager.get_current_vfs()
        resolved_path = self.workspace_manager.resolve_path(path)
    
        node = await vfs.get_node_info(resolved_path)
        if not node:
            raise ValueError(f"Path not found: {resolved_path}")
    
        if node.is_dir and not recursive:
            raise ValueError(
                "Cannot remove directory without recursive=True. "
                "Use recursive=True to remove directories."
            )
    
        if node.is_dir:
            await vfs.rmdir(resolved_path)
        else:
            await vfs.rm(resolved_path)
    
        return RemoveResponse(success=True, path=resolved_path)
  • Registration of the 'rm' tool on the MCP server, wrapping and delegating to VFSTools.rm.
    @server.tool
    async def rm(path: str, recursive: bool = False):
        """Remove file or directory."""
        return await vfs_tools.rm(path, recursive)
  • Pydantic schema for the 'rm' tool response.
    class RemoveResponse(BaseModel):
        """Response from rm operation"""
    
        success: bool
        path: str
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 is 'remove' but does not clarify if deletions are permanent, reversible, or require specific permissions. It mentions 'file or directory' but omits details on the 'recursive' parameter's effect or potential side effects, leaving significant gaps 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 wasted words, making it easy to parse and front-loaded with the core action. Every word earns its place by conveying essential information without redundancy or fluff.

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 tool's destructive nature, lack of annotations, no output schema, and low schema coverage, the description is inadequate. It fails to address critical aspects like safety warnings, return values, or error conditions, making it incomplete for safe and effective use in a complex environment with siblings like workspace management tools.

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 description implies a 'path' parameter by referencing 'file or directory' and hints at directory handling that relates to 'recursive', but with 0% schema description coverage, it does not fully compensate. It adds minimal meaning beyond the schema, such as clarifying the target types, but leaves parameters like 'recursive' and exact path syntax undocumented.

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 'Remove file or directory' clearly states the action (remove) and target (file or directory), making the purpose immediately understandable. It does not distinguish from sibling tools like 'mv' (move) or 'cp' (copy), but it is specific enough to avoid vagueness or tautology.

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 'mv' for moving files or 'workspace_destroy' for broader deletions. It lacks explicit context, prerequisites, or exclusions, leaving usage entirely implied from the tool name and basic functionality.

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/IBM/chuk-mcp-vfs'

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