Skip to main content
Glama

get_block_documents

Retrieve block documents from Prefect workflows by specifying a block type, with options to filter by name, limit results, and paginate through large datasets.

Instructions

Get block documents by block type.

Args: block_type_slug: The block type slug limit: Maximum number of block documents to return offset: Number of block documents to skip name: Filter by name pattern

Returns: A list of block documents with their details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
block_type_slugYes
limitNo
nameNo
offsetNo

Implementation Reference

  • The main handler function for the 'get_block_documents' tool. It is decorated with @mcp.tool, which registers it as an MCP tool. The function retrieves block documents from the Prefect client using filters based on block_type_slug, optional limit, offset, and name pattern, formats the result as text content, and returns it.
    @mcp.tool
    async def get_block_documents(
        block_type_slug: str,
        limit: Optional[int] = None,
        offset: Optional[int] = None,
        name: Optional[str] = None,
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        """
        Get block documents by block type.
        
        Args:
            block_type_slug: The block type slug
            limit: Maximum number of block documents to return
            offset: Number of block documents to skip
            name: Filter by name pattern
            
        Returns:
            A list of block documents with their details
        """
        async with get_client() as client:
            # Build filter parameters
            filters = {}
            if block_type_slug:
                filters["block_type_slug"] = {"eq_": block_type_slug}
            if name:
                filters["name"] = {"like_": f"%{name}%"}
            
            block_documents = await client.read_block_documents(
                limit=limit,
                offset=offset,
                **filters
            )
            
            block_documents_result = {
                "block_documents": [block_doc.model_dump() for block_doc in block_documents]
            }
            
            return [types.TextContent(type="text", text=str(block_documents_result))]
  • The @mcp.tool decorator registers the get_block_documents function as an MCP tool.
    @mcp.tool
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions filtering by name pattern and pagination (limit/offset), but doesn't disclose critical behaviors like whether this is a read-only operation, authentication requirements, rate limits, error conditions, or what 'details' in the return includes. For a tool with 4 parameters and no annotation coverage, this is insufficient.

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 efficiently structured with a clear purpose statement followed by parameter explanations and return information. Each sentence adds value, though the 'Args:' and 'Returns:' formatting could be more integrated. It's appropriately sized for the tool's complexity.

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 4 parameters with 0% schema coverage and no output schema, the description provides adequate parameter semantics but lacks behavioral context. It mentions what the tool returns ('list of block documents with their details') but doesn't specify format, structure, or example. For a read operation with filtering and pagination, more behavioral disclosure would be helpful.

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?

The description adds meaningful context beyond the 0% schema coverage. It explains that 'block_type_slug' filters by block type, 'limit' controls maximum returns, 'offset' enables skipping, and 'name' filters by pattern - providing clear semantic meaning for all 4 parameters. This compensates well for the lack of schema descriptions.

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 verb 'Get' and resource 'block documents by block type', making the purpose evident. It distinguishes from sibling 'get_block_document' (singular) by indicating it retrieves multiple documents. However, it doesn't fully differentiate from other list tools like 'get_block_types' or 'get_variables' beyond the specific resource type.

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 prerequisites, appropriate contexts, or compare it to similar tools like 'get_block_document' (singular) or other filtering options. The agent must infer usage from the name and parameters 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