Skip to main content
Glama

close_workspace_tab

Close unnecessary ComfyUI workflow tabs to free up the interface, with safeguards against losing unsaved work and preventing the last tab from closing.

Instructions

Close one of the workflow tabs open in the ComfyUI window.

The counterpart to switch_workspace_tab, and the way to tidy up after a run of loads - each one opens its own tab, and they stay until something closes them.

Nothing here is written to disk and nothing can be undone. A closed workflow is out of the tab bar; if it had unsaved changes, they are gone. So a tab with unsaved changes is refused unless force says otherwise, and only ComfyUI's own Save in the browser clears that flag - save_workspace writes a copy to disk and leaves the workflow just as modified.

Closing the tab on screen moves to a neighbour first, so the canvas never ends up showing a workflow that is no longer open. The last remaining tab is refused: closing it would leave the window with nothing.

Args: tab: which one - an index from switch_workspace_tab, its path, or its filename. Empty closes the tab currently on screen. A name matching two open tabs is refused rather than guessed. force: close even when the tab has unsaved changes, losing them. client_id: which browser tab to ask; defaults to the most recently focused.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabNo
forceNo
client_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description fully discloses the irreversible nature, the unsaved changes risk, the force behavior, tab matching ambiguity, the refusal of the last remaining tab, and the canvas neighborhood transition. It also states that nothing is written to disk and nothing can be undone, providing essential behavioral context beyond 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 organized into a purpose paragraph, a behavioral caution paragraph, a canvas behavior note, and a parameter list. Every sentence adds useful information, and the structure makes it easy to scan. While detailed, each part contributes to safe selection and effective invocation.

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?

The tool has an output schema and no required parameters, and the description still covers why, when, how, and what consequences apply. It explains ambiguous cases, refused edge cases, and save-related interaction with other tools. The description is fully sufficient for an agent to select and call this tool correctly.

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?

Even though the input schema has no descriptions (coverage 0%), the description explains all three parameters clearly: tab's accepted forms (index/path/filename/empty), force's meaning and risk, and client_id's role as the browser tab identifier. This fully compensates for the schema gap.

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 verb and resource: "Close one of the workflow tabs open in the ComfyUI window." It clearly distinguishes itself from related tools like switch_workspace_tab, save_workspace, and the various workspace manipulation tools by focusing on tab lifecycle cleanup.

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 explicitly frames when to use this tool: as the counterpart to switch_workspace_tab, and as the way to tidy up after loads that each open a tab. It contrasts behavior with save_workspace and explains that only ComfyUI's own Save clears the dirty flag, giving clear functional context and exclusions.

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

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