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
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states this is a read operation ('Get'), implying it's non-destructive, but doesn't disclose behavioral traits like authentication requirements, rate limits, error handling, or what 'Workspace details' includes. This is inadequate for a tool with no 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured with a clear purpose statement followed by Args and Returns sections. Every sentence adds value, though it could be more front-loaded by integrating parameter details into the main description.

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 no annotations, 0% schema coverage, and no output schema, the description is incomplete. It doesn't explain the return value 'Workspace details' or address error cases, making it inadequate for a tool that likely returns complex data. More context is needed for effective use.

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

Parameters3/5

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

The description adds minimal semantics by specifying 'workspace_id: The workspace UUID,' which clarifies the parameter type beyond the schema's generic 'string' type. However, with 0% schema description coverage and only one parameter, this provides basic but insufficient detail, such as format examples or validation rules.

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 tool's purpose as 'Get a workspace by ID,' which is a specific verb+resource combination. However, it doesn't distinguish this tool from its sibling 'get_workspace_by_handle' or 'get_workspaces,' which limits its differentiation from alternatives.

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 'get_workspace_by_handle' or 'get_workspaces.' It lacks context about prerequisites, such as needing a UUID versus a handle, or when to prefer this over listing all workspaces.

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

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