Skip to main content
Glama

get_current_workspace

Retrieve details about the current Prefect workspace to identify active workflow automation environment and available resources.

Instructions

Get the current workspace.

Returns: Details of the current workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'get_current_workspace' tool handler function. Decorated with @mcp.tool, it uses the Prefect client to read the current workspace and returns its details as text content, with fallback for local instances.
    @mcp.tool
    async def get_current_workspace() -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        """
        Get the current workspace.
        
        Returns:
            Details of the current workspace
        """
        try:
            async with get_client() as client:
                workspace = await client.read_workspace()
                
                return [types.TextContent(type="text", text=str(workspace.dict()))]
        except Exception as e:
            # For local Prefect instances, workspace APIs may not be available
            return [types.TextContent(
                type="text",
                text="Workspaces are only available in Prefect Cloud. This appears to be a local Prefect instance."
            )]

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/allen-munsch/mcp-prefect'

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