Skip to main content
Glama

get_workspace

Retrieve workspace details from Prefect's workflow automation platform by providing the workspace UUID to access specific workflow environments and configurations.

Instructions

Get a workspace by ID.

Args: workspace_id: The workspace UUID

Returns: Workspace details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_idYes

Implementation Reference

  • The @mcp.tool decorated handler function that implements the get_workspace tool. It fetches the workspace details by ID using the Prefect client and returns it as TextContent, with fallback message for local instances.
    @mcp.tool async def get_workspace( workspace_id: str, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """ Get a workspace by ID. Args: workspace_id: The workspace UUID Returns: Workspace details """ try: async with get_client() as client: workspace = await client.read_workspace_by_id(UUID(workspace_id)) 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." )]
  • The conditional import of the workspace module in main.py, which triggers the registration of workspace tools (including get_workspace) via their @mcp.tool decorators when the Workspace API is enabled.
    if APIType.WORKSPACE.value in apis: info("Loading Workspace API...") from . import workspace

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