Skip to main content
Glama

workspace_switch

Switch between virtual filesystem workspaces to manage files across different storage providers and scopes.

Instructions

Switch to a different workspace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • Registers the workspace_switch tool using @server.tool decorator, delegating to workspace_tools.workspace_switch
    @server.tool
    async def workspace_switch(name: str):
        """Switch to a different workspace."""
        return await workspace_tools.workspace_switch(name)
  • Main handler logic for the workspace_switch tool: calls workspace_manager.switch_workspace and constructs WorkspaceSwitchResponse
    async def workspace_switch(self, name: str) -> WorkspaceSwitchResponse:
        """
        Switch to a different workspace.
    
        Args:
            name: Workspace name to switch to
    
        Returns:
            WorkspaceSwitchResponse with new current workspace info
        """
        info = await self.workspace_manager.switch_workspace(name)
    
        return WorkspaceSwitchResponse(
            name=info.name,
            provider=info.provider_type,
            current_path=info.current_path,
            is_mounted=info.is_mounted,
        )
  • Pydantic model defining the response schema for workspace_switch tool
    class WorkspaceSwitchResponse(BaseModel):
        """Response from workspace switch"""
    
        name: str
        provider: ProviderType
        current_path: str
        is_mounted: bool
  • Core helper method in WorkspaceManager that performs the actual workspace switch by updating current_namespace_id
    async def switch_workspace(self, name: str) -> WorkspaceInfo:
        """
        Switch to a different workspace.
    
        Args:
            name: Workspace name
    
        Returns:
            WorkspaceInfo for the switched workspace
    
        Raises:
            ValueError: If workspace doesn't exist
        """
        # Find namespace by name
        for nid, info in self._namespace_to_info.items():
            if info.name == name:
                self._current_namespace_id = nid
                return info
    
        raise ValueError(f"Workspace '{name}' does not exist")
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. 'Switch to a different workspace' implies a state change but doesn't clarify what happens during the switch (e.g., does it affect current operations, require specific permissions, or have side effects like unmounting resources?). It lacks details on success/failure responses, making it inadequate for a mutation tool with zero annotation coverage.

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 with zero wasted words, making it highly concise and front-loaded. It efficiently communicates the core action without unnecessary elaboration, earning full marks for brevity and structure.

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 state-changing operation with 1 parameter), lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't address behavioral aspects, parameter meaning, or expected outcomes, leaving significant gaps for an agent to understand and invoke the tool correctly.

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 input schema has 1 parameter with 0% description coverage, and the tool description provides no information about the 'name' parameter. It doesn't explain what the name refers to (e.g., an existing workspace identifier), its format, or examples, failing to compensate for the schema's lack of 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 ('switch') and target ('to a different workspace'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like workspace_create or workspace_mount, which would require more specific context about what 'switching' entails versus creating or mounting workspaces.

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 workspace_list (to see available workspaces) or workspace_create (to make a new one). There's no mention of prerequisites (e.g., needing an existing workspace name) or exclusions, leaving the agent to infer usage context from the tool name alone.

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