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

  • Registration of the 'workspace_switch' MCP tool. This decorator registers the function as a tool with the MCP server, which delegates to the implementation in WorkspaceTools.
    @server.tool async def workspace_switch(name: str): """Switch to a different workspace.""" return await workspace_tools.workspace_switch(name)
  • Core handler function in WorkspaceTools class that performs the workspace switch by calling the workspace_manager and returns a structured response.
    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 the workspace_switch tool.
    class WorkspaceSwitchResponse(BaseModel): """Response from workspace switch""" name: str provider: ProviderType current_path: str is_mounted: bool

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

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