Skip to main content
Glama

cp

Copy files or directories within virtual filesystem workspaces to duplicate content across storage providers and scopes.

Instructions

Copy file or directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Implementation Reference

  • The VFSTools.cp method implements the core logic of the 'cp' tool by resolving source and destination paths relative to the current workspace and delegating the copy operation to the underlying virtual filesystem (vfs.cp).
    async def cp(self, request: CopyRequest) -> CopyResponse:
        """
        Copy file or directory.
    
        Args:
            request: CopyRequest with source, dest, and recursive flag
    
        Returns:
            CopyResponse with success status
        """
        vfs = self.workspace_manager.get_current_vfs()
        resolved_source = self.workspace_manager.resolve_path(request.source)
        resolved_dest = self.workspace_manager.resolve_path(request.dest)
    
        # Note: cp method doesn't have recursive parameter in AsyncVirtualFileSystem
        # It handles directories automatically
        await vfs.cp(resolved_source, resolved_dest)
    
        return CopyResponse(success=True, source=resolved_source, dest=resolved_dest)
  • Registers the 'cp' tool with the MCP server, delegating execution to the VFSTools.cp method.
    @server.tool
    async def cp(request: CopyRequest):
        """Copy file or directory."""
        return await vfs_tools.cp(request)
  • Pydantic models defining the input schema (CopyRequest with source, dest, recursive) and output schema (CopyResponse with success, source, dest) for the 'cp' tool.
    class CopyRequest(BaseModel):
        """Request to copy file/directory"""
    
        source: str
        dest: str
        recursive: bool = False
    
    
    class CopyResponse(BaseModel):
        """Response from cp operation"""
    
        success: bool
        source: str
        dest: 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 'Copy file or directory,' which implies a read-and-write operation, but doesn't specify permissions needed, whether it overwrites existing files, handles errors, or provides feedback. This is a significant gap for a mutation tool.

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 extremely concise with a single sentence ('Copy file or directory.'), which is front-loaded and wastes no words. It efficiently communicates the core action, making it easy to scan and understand quickly.

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 complexity (a mutation operation with one undocumented parameter), no annotations, and no output schema, the description is incomplete. It fails to address key aspects like parameter format, behavioral details, or output expectations, making it inadequate for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the single parameter 'request' is undocumented. The description doesn't add any meaning beyond the schema—it doesn't explain what 'request' should contain (e.g., source and destination paths), leaving parameter usage ambiguous and incomplete.

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 ('Copy') and resource ('file or directory'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'mv' (move) or 'write' (create/write), which could also involve file operations, so it doesn't reach the highest score.

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 'write' for creating files. It lacks context about prerequisites, such as whether source and destination paths must be specified in the request parameter, leaving usage unclear.

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