Skip to main content
Glama

get_workspace_by_handle

Retrieve workspace details using account and workspace handles to access specific workflow automation environments in Prefect.

Instructions

Get a workspace by its handle.

Args: account_handle: The account handle workspace_handle: The workspace handle

Returns: Workspace details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_handleYes
workspace_handleYes

Implementation Reference

  • The main handler function for the 'get_workspace_by_handle' MCP tool. It is decorated with @mcp.tool, which registers it. The function retrieves the Prefect workspace using the provided account_handle and workspace_handle via the Prefect client and returns its details as text content.
    @mcp.tool
    async def get_workspace_by_handle(
        account_handle: str,
        workspace_handle: str,
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        """
        Get a workspace by its handle.
        
        Args:
            account_handle: The account handle
            workspace_handle: The workspace handle
            
        Returns:
            Workspace details
        """
        try:
            async with get_client() as client:
                workspace = await client.read_workspace_by_handle(
                    account_handle=account_handle,
                    workspace_handle=workspace_handle
                )
                
                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."
            )]
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a 'Get' operation, implying read-only behavior, but doesn't explicitly confirm it's safe/non-destructive. It also doesn't describe error conditions (e.g., what happens if the handle doesn't exist), rate limits, or authentication requirements, leaving 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 appropriately brief and front-loaded with the core purpose in the first sentence. The Args/Returns sections are structured but could be more integrated. There's minimal waste, though the 'Returns' line is vague without an output schema.

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?

For a read operation with 2 parameters, 0% schema coverage, and no output schema, the description is insufficient. It lacks details on parameter semantics, return format, error handling, and sibling differentiation. While simple tools need less documentation, this leaves too many gaps for reliable agent use.

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

Parameters2/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 lists the two parameters but provides no additional semantic context beyond their names. It doesn't explain what an 'account_handle' or 'workspace_handle' is, their format, or how they relate to each other, leaving parameters largely undocumented.

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 with a specific verb ('Get') and resource ('workspace by its handle'), making it immediately understandable. However, it doesn't distinguish this tool from its sibling 'get_workspace' (which presumably retrieves a workspace by ID rather than handle), missing an opportunity for full differentiation.

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' or 'get_workspaces'. It also doesn't mention prerequisites or context for when this specific lookup method is appropriate, leaving the agent to infer usage from the tool name alone.

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