get_history
Retrieve recent ComfyUI generation history to view past workflow jobs, outputs, and statuses for monitoring and analysis.
Instructions
Get recent generation history.
Args:
limit: Maximum number of history entries (1-100, default: 10)
Returns history entries with outputs and status for each job.
Use this to see past generations and their results.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max entries to return |
Implementation Reference
- The MCP tool handler for 'get_history', decorated with @mcp.tool(). Fetches recent ComfyUI generation history using the limit parameter and handles errors.@mcp.tool() def get_history( limit: int = Field(default=10, ge=1, le=100, description="Max entries to return"), ctx: Context = None, ) -> dict: """Get recent generation history. Args: limit: Maximum number of history entries (1-100, default: 10) Returns history entries with outputs and status for each job. Use this to see past generations and their results. """ if ctx: ctx.info(f"Fetching last {limit} history entries...") try: return comfy_get(f"/history?max_items={limit}") except Exception as e: return ErrorResponse.unavailable(str(e)).model_dump()
- src/comfy_mcp_server/api.py:219-222 (helper)Helper function in api.py that performs the actual API call to retrieve history, used by the tool handler.def get_history(max_items: int = 10) -> dict: """Get generation history.""" return comfy_get(f"/history?max_items={max_items}")