Skip to main content
Glama

get_workspaces

Retrieve a list of accessible Prefect workspaces with optional filtering by name, pagination controls, and workspace details to help manage workflow automation environments.

Instructions

Get a list of accessible workspaces.

Args: limit: Maximum number of workspaces to return offset: Number of workspaces to skip name: Filter workspaces by name (note: filtering may not be supported by all Prefect versions)

Returns: A list of workspaces with their details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
nameNo
offsetNo

Implementation Reference

  • The main handler function for the 'get_workspaces' tool, decorated with @mcp.tool which registers it. Fetches workspaces using the Prefect client and handles local vs Cloud differences.
    @mcp.tool
    async def get_workspaces(
        limit: Optional[int] = None,
        offset: Optional[int] = None,
        name: Optional[str] = None,
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        """
        Get a list of accessible workspaces.
        
        Args:
            limit: Maximum number of workspaces to return
            offset: Number of workspaces to skip
            name: Filter workspaces by name (note: filtering may not be supported by all Prefect versions)
            
        Returns:
            A list of workspaces with their details
        """
        try:
            async with get_client() as client:
                workspaces = await client.read_workspaces(
                    limit=limit,
                    offset=offset,
                )
                
                workspaces_result = {
                    "workspaces": [workspace.dict() for workspace in workspaces]
                }
                
                return [types.TextContent(type="text", text=str(workspaces_result))]
        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."
            )]
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 mentions 'accessible workspaces,' hinting at permission-based filtering, but lacks details on authentication needs, rate limits, pagination behavior (beyond args), error handling, or what 'accessible' entails. For a read operation with zero annotation coverage, this leaves significant behavioral gaps.

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 well-structured and appropriately sized. It front-loads the purpose, followed by a clear 'Args' and 'Returns' section. Every sentence adds value, with no redundant information, though the note on filtering support could be more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/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 does a decent job but has gaps. It covers parameters well and states the return type, but lacks details on authentication, error cases, pagination beyond args, and sibling differentiation. For a list-fetching tool, it's minimally adequate but not fully complete.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It provides clear semantics for all three parameters: 'limit' as maximum return count, 'offset' as skip count, and 'name' as a filter with a note on version support. This adds meaningful context beyond the bare schema, though it doesn't specify default values or filtering syntax.

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: 'Get a list of accessible workspaces.' It uses a specific verb ('Get') and resource ('workspaces'), and clarifies scope with 'accessible.' However, it doesn't explicitly differentiate from sibling tools like 'get_workspace' or 'get_workspace_by_handle,' which appear to fetch single 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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention sibling tools like 'get_workspace' (for a single workspace) or 'get_current_workspace,' nor does it specify prerequisites or contexts for usage, such as authentication requirements or workspace access levels.

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