get_block_document
Retrieve detailed information about a specific Prefect block document using its unique identifier to access configuration and settings for workflow automation components.
Instructions
Get a block document by ID.
Args: block_document_id: The block document UUID
Returns: Block document details
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"block_document_id": "<block_document_id>"
},
"name": "get_block_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| block_document_id | Yes |
Implementation Reference
- src/mcp_prefect/block.py:106-122 (handler)The main handler function for the 'get_block_document' MCP tool. It is decorated with @mcp.tool, which registers it. The function fetches a Prefect block document by its UUID using the Prefect client and returns its details as text content.
@mcp.tool async def get_block_document( block_document_id: str, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """ Get a block document by ID. Args: block_document_id: The block document UUID Returns: Block document details """ async with get_client() as client: block_document = await client.read_block_document(UUID(block_document_id)) return [types.TextContent(type="text", text=str(block_document.model_dump()))]