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}")
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adequately describes the core behavior (retrieving history entries with outputs and status) and implies read-only operation through 'Get' and 'see past generations.' However, it lacks details about pagination, rate limits, authentication requirements, or what happens when no history exists - gaps for a tool with no annotation coverage.

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 appropriately sized with three brief sentences that each serve a purpose: stating the tool's purpose, documenting the parameter, and providing usage guidance. It's front-loaded with the core purpose first. The only minor inefficiency is repeating parameter information already in the schema.

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?

For a single-parameter read operation with no output schema, the description provides adequate but minimal coverage. It explains what the tool does and what it returns, but lacks details about the return format structure, error conditions, or how 'recent' is defined. With no annotations and no output schema, more behavioral context would be beneficial.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents the 'limit' parameter with range, default, and description. The description repeats this information in the Args section but adds no additional semantic context beyond what's in the schema. This meets the baseline for high schema coverage.

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 tool's purpose with 'Get recent generation history' - a specific verb ('Get') and resource ('generation history'). It distinguishes itself from siblings by focusing on historical data retrieval rather than current operations (like get_queue_status) or workflow management tools. However, it doesn't explicitly contrast with all possible siblings like get_system_stats.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage context with 'Use this to see past generations and their results,' suggesting it's for reviewing completed jobs. However, it doesn't explicitly state when to use this versus alternatives like get_queue_status (for pending jobs) or get_prompt_status (for specific job status), nor does it mention any exclusions or prerequisites.

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

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