Skip to main content
Glama

get_block_types

Retrieve available block types from Prefect workflows with filtering options to find specific components for workflow automation.

Instructions

Get a list of block types with optional filtering.

Args: limit: Maximum number of block types to return offset: Number of block types to skip slug: Filter by slug pattern

Returns: A list of block types with their details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
slugNo

Implementation Reference

  • The handler function implementing the 'get_block_types' MCP tool. It uses the Prefect client to fetch block types with optional filters and returns the result as text content.
    @mcp.tool
    async def get_block_types(
        limit: Optional[int] = None,
        offset: Optional[int] = None,
        slug: Optional[str] = None,
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        """
        Get a list of block types with optional filtering.
        
        Args:
            limit: Maximum number of block types to return
            offset: Number of block types to skip
            slug: Filter by slug pattern
            
        Returns:
            A list of block types with their details
        """
        async with get_client() as client:
            # Build filter parameters
            filters = {}
            if slug:
                filters["slug"] = {"like_": f"%{slug}%"}
            
            block_types = await client.read_block_types(
                # 
                # limit=limit,
                # offset=offset,
                # **filters
            )
            
            block_types_result = {
                "block_types": [block_type.model_dump() for block_type in block_types]
            }
            
            return [types.TextContent(type="text", text=str(block_types_result))]

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