Skip to main content
Glama

get_defaults

Retrieve and update generation defaults and ComfyUI UI settings: get/set image parameters and frontend preferences, with optional persistence.

Instructions

Read and write settings — either OUR generation defaults or ComfyUI's own frontend UI settings. These are two SEPARATE stores and the action says which one you mean:

  • action:"get" — Return the merged view of OUR generation defaults with per-source attribution. Precedence (lowest → highest): config file → COMFYUI_DEFAULT_* env vars → runtime overrides via action:"set". Per-call MCP tool args always win over these defaults when consumed by a workflow-construction tool. Read-only, and works even with no ComfyUI running.

  • action:"set" — Update OUR generation defaults from values. By default updates the in-memory runtime layer (lost on restart); pass persist:true to also write the change into the config file (~/.config/comfyui-mcp/config.json by default). Use this to avoid repeating common values like width, height, steps, cfg, sampler, checkpoint.

  • action:"get_ui" — Read COMFYUI's OWN per-user frontend UI settings (the Comfy.* ids its Settings panel writes, served by the frontend user manager). This is a DIFFERENT store from action:"get" — nothing here feeds our generation defaults. Read-only. Provide id to read one setting's raw stored value; omit id to list all stored settings (optionally narrowed by filter). Known ids include Comfy.Validation.Workflows (boolean; its strictness rejects some custom-node workflows), Comfy.PreviewMethod (auto|latent2rgb|taesd|none), Comfy.LinkRenderMode (0 straight / 1 linear / 2 spline / 3 hidden), Comfy.UseNewMenu, and Comfy.Sidebar.Location. Ids are frontend-defined and stored verbatim; keys never written by the user are absent here and fall back to invisible frontend defaults. Values are surfaced with their raw stored type (no coercion). Requires a reachable local or remote ComfyUI; not available in Comfy Cloud mode.

  • action:"set_ui" — Modify one of COMFYUI's OWN persisted frontend UI settings by id. This writes ComfyUI's user settings store, NOT our generation defaults (that is action:"set"). The change is persisted immediately and takes effect on the next frontend load/refresh (an already-open UI tab keeps its old value until reloaded). The value is stored as-is: booleans/numbers are NOT coerced from strings, so pass true (not "true") and 2 (not "2"). Known ids: Comfy.Validation.Workflows (boolean; loosening it lets stricter custom-node workflows load), Comfy.PreviewMethod (auto|latent2rgb|taesd|none), Comfy.LinkRenderMode (0 straight / 1 linear / 2 spline / 3 hidden), Comfy.UseNewMenu, Comfy.Sidebar.Location. Ids are frontend-defined; an unknown id is stored verbatim and simply ignored by the UI. Returns { id, previous, value } — the prior value is read first so you can report and undo the change (previous is null when the key was unset).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoComfyUI UI setting id, e.g. 'Comfy.Validation.Workflows'. REQUIRED for action:"set_ui". OPTIONAL for action:"get_ui" — omit to list all stored settings.
valueNoaction:"set_ui" — REQUIRED. New value for the ComfyUI UI setting. Stored as-is; booleans/numbers are NOT coerced from strings (pass true, not "true").
actionYesWhich settings operation to perform, and on WHICH store. "get"/"set" are the MCP server's own generation defaults (width, steps, cfg, …); "get_ui"/"set_ui" are ComfyUI's separate frontend UI settings (the Comfy.* ids). "get" takes no other parameters; "set" requires `values` (optional `persist`); "get_ui" takes an optional `id` or `filter`; "set_ui" requires `id` + `value`.
filterNoaction:"get_ui" — case-insensitive substring filter on setting ids when listing (e.g. 'preview'). Ignored when `id` is given.
valuesNoaction:"set" — REQUIRED. Key/value map of GENERATION defaults to set. Keys are typically lowercase (e.g. width, steps). Not for Comfy.* UI ids — those go through action:"set_ui".
persistNoaction:"set" — if true, write to the config file in addition to runtime.
Behavior5/5

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

With no annotations, the description carries the full burden and exceeds it. It discloses persistence semantics (runtime vs config file), type coercion rules ('booleans/numbers are NOT coerced from strings'), timing effects ('takes effect on the next frontend load/refresh'), return shape ('{ id, previous, value }'), and availability constraints. There is no contradiction with annotations.

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 every sentence carries distinct, non-redundant information. It is structured with clear action bullets, a precedence list, and known-id examples, making the density acceptable. It is appropriately front-loaded with the core 'two separate stores' concept, so a reader can quickly grasp the main idea.

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?

Given the tool's complexity (4 actions, 6 params, nested objects, no output schema), the description is remarkably complete. It covers return values where relevant, known UI ids, edge cases like 'keys never written by the user are absent', and operational prerequisites. Any minor gaps (e.g., exact return of 'set') are negligible given the overall thoroughness.

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?

Though schema coverage is 100%, the description adds significant meaning beyond the schema. It explains conditional parameter requirements per action, clarifies that 'values' keys are 'typically lowercase' and NOT Comfy.* ids, defines filter as a case-insensitive substring, and details the exact types expected for set_ui values. This goes far beyond the schema's baseline.

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 specific, salient summary: 'Read and write settings — either OUR generation defaults or ComfyUI's own frontend UI settings.' It then enumerates four distinct actions, each with its own verb, target store, and behavior, making the tool's purpose unmistakable and clearly distinguishing it from any sibling.

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?

Usage guidance is explicit and operational: it says when to use 'set' ('to avoid repeating common values'), when 'get_ui' is unavailable ('not available in Comfy Cloud mode'), and that 'get_ui'/'set_ui' target a 'DIFFERENT store' from 'get'/'set'. It even explains precedence and fallback behavior, leaving no ambiguity about which action fits which scenario.

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