Skip to main content
Glama

get_history

Retrieve recent ComfyUI workflow generation history to view past jobs, their outputs, and status information for tracking 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
NameRequiredDescriptionDefault
limitNoMax entries to return

Implementation Reference

  • The MCP tool handler for 'get_history'. Fetches the recent ComfyUI generation history (up to 'limit' items) using the ComfyUI /history API endpoint. Includes input validation via Pydantic Field and error handling.
    @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()
  • Within register_all_tools(mcp), calls register_system_tools(mcp) which defines and registers the get_history tool among system tools.
    register_system_tools(mcp)
  • Top-level registration of all tools, which includes the system tools containing get_history.
    register_all_tools(mcp)
  • Helper function in API module that performs the core API call for history, directly mirrored in the tool handler.
    def get_history(max_items: int = 10) -> dict: """Get generation history.""" return comfy_get(f"/history?max_items={max_items}")

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/IO-AtelierTech/comfyui-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server