Skip to main content
Glama

get_history

Retrieve ComfyUI execution history to review past runs, diagnose failed renders with missing models or node types, and get proven settings from your own generation statistics.

Instructions

Read what has already been generated on this machine — execution history, why a run failed, and the settings your past renders actually used. Driven by the action parameter:

  • action:"list" — Execution history for a ComfyUI prompt: status, timing, cached nodes, and output details (media filenames for get_image action:"get"). Also carries the raw error/traceback. To diagnose WHY a run FAILED or what is missing, prefer action:"diagnose" — it returns the same failure info PLUS missing models (with the file + widget) and missing node types, which this action does not. Use action:"list" when you need the run's OUTPUTS or timing for a specific prompt_id.

  • action:"diagnose" — WHY DID MY RENDER FAIL / WHAT IS MISSING? Explains a failed run in ONE call, without needing a canvas — the headless counterpart to the panel's panel_get_errors ("why is this red?"), so mobile/remote sessions get the same answer. Returns: the failed node (id, type) with its exception_type + message and a trimmed traceback; missing_models (the exact model file that is not installed and the widget holding it — feed the filename to download_model action:'search_civitai', then action:'download_civitai' — or action:'search' then action:'download' — to fix it); missing_node_types (node classes this install lacks — feed to search_custom_nodes, then install_custom_node); and any other per-input validation errors. Call this whenever a run fails, an enqueue is rejected, or the user asks what is missing — instead of guessing from raw logs. With no prompt_id it diagnoses the most recent FAILED run (falling back to the most recent run). Read-only.

  • action:"stats" — Statistics from this MCP server's LOCAL generation-history database (populated as you run workflows; NOT from ComfyUI, and not the same source as action:"list"): total generations, count of unique sampler/scheduler/steps/CFG combos, a per-model-family breakdown, and the most-reused settings. Read-only; works without a running ComfyUI. Returns empty stats until you have generated images. For concrete recommended settings rather than aggregate counts, use action:"suggest".

  • action:"suggest" — Recommend concrete, proven sampler/scheduler/steps/CFG (and denoise/shift/LoRA) settings derived from that same LOCAL generation-history database. Read-only and works without a running ComfyUI. Narrow results by model_family, lora_hash, or a name search; with no filter it returns the top settings across all history. Returns a ranked list with each combo's reuse count, or a "no history" message until you have generated images. Use this for ready-to-apply values; use action:"stats" for aggregate counts and breakdowns rather than specific suggestions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoaction:"suggest" — max results (default 10).
actionYesWhich history view to return. "list" and "diagnose" read ComfyUI's execution history and take an optional `prompt_id`; "stats" and "suggest" read this server's own local generation-settings database and take `model_family` (plus `lora_hash`/`search`/`limit` for "suggest"). No action requires any other field.
searchNoaction:"suggest" — full-text search on model/LoRA filenames (e.g. 'copax', 'lightning').
lora_hashNoaction:"suggest" — AutoV2 hash (10 chars) of a specific LoRA to find settings for.
prompt_idNoActions "list" and "diagnose" — the prompt ID to look up (returned by enqueue_workflow). For action:"list", if omitted, returns the most recent COMMITTED execution (chosen by ComfyUI's queue number, not dict order); immediately after a run finishes it can briefly lag by one until ComfyUI commits the new entry, so pass the prompt_id from enqueue_workflow to get that exact run, and prefer the run-finished event for naming a just-produced output. For action:"diagnose", omit to diagnose the most recent FAILED run — preferred over a newer successful one — falling back to the most recent run if nothing failed.
model_familyNoActions "stats" and "suggest" — model-family key to scope to, e.g. 'sdxl', 'flux', 'qwen_image', 'illustrious'.
Behavior5/5

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

With no annotations provided, the description fully carries the behavioral disclosure burden. It does so admirably: repeatedly states read-only guarantees, clarifies that stats/suggest use a LOCAL database not ComfyUI, explains the fallback to most recent failed/successful run, warns about lag after a run finishes, and notes that stats return empty until generations exist. No contradictions with annotations since none exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but inherently complex with four actions and six parameters. It front-loads the core purpose in the first sentence, then uses clear bullets and action-specific subsections. Every sentence delivers distinct information: edge cases, fallbacks, data-source distinctions, and cross-tool links. No wasted words or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a multi-action tool with no output schema and no annotations, this description is exceptionally complete. It covers return values (status, timing, filenames, error tracebacks, missing models, node types, statistics), behavioral nuances (empty stats, lag, fallback logic), and prerequisites (works without ComfyUI for stats/suggest). It also provides actionable next steps for failure diagnosis, making it fully self-contained.

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

Parameters5/5

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

Although the schema already covers 100% of parameters, the description adds substantial semantic value: it maps each parameter to specific actions, explains defaults (limit default 10, prompt_id omission behavior), clarifies that prompt_id behaves differently for list vs diagnose, and gives example values (model_family: 'sdxl', 'flux'). It also explains which parameters interact with which actions, going far beyond the schema's short descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a clear verb+resource statement: "Read what has already been generated on this machine" and then enumerates four specific actions (list, diagnose, stats, suggest) each with a distinct purpose. It clearly differentiates from siblings like get_image and get_workflow by focusing on execution history, failures, and settings usage.

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

Usage Guidelines5/5

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

The description provides explicit when-to-use guidance: 'To diagnose WHY a run FAILED or what is missing, prefer action:"diagnose"', 'Use action:"list" when you need the run's OUTPUTS or timing', and 'Call this whenever a run fails... instead of guessing from raw logs.' It also names alternative tools for follow-up actions (download_model, search_custom_nodes) and contrasts stats vs suggest. This is model-level guidance.

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

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