Skip to main content
Glama

discover

Retrieve comfy-cli's command schemas and capabilities at runtime so agents can learn the CLI contract dynamically instead of hard-coding it.

Instructions

Return comfy-cli's self-describing command surface (its own contract).

Wraps comfy discover so an agent can learn the CLI's contract at runtime instead of hard-coding it.

Args: schemas_only: forwards --schemas-only to the CLI (default True). command: return ONE schema body by name instead of the index.

Sizes matter here because MCP clients cap tool output (e.g. Claude Code's MAX_MCP_OUTPUT_TOKENS, default 25,000) by TRUNCATING mid-JSON, so an oversized reply comes back broken rather than short:

  • discover() — the default. Capabilities, version, command schemas, and a schema_index of names. A couple of KB; always under the cap.

  • discover(command="run") — one schema body (~1.6 KB).

  • discover(schemas_only=False) — the entire surface, commands tree and error_codes included. Big; only for a client with a raised cap.

The default USED to return all 35 schema bodies — ~63 KB from the CLI and ~109 KB once pretty-printed, which exceeded a standard cap and made the tool uncallable at its own default. Measured on comfy-cli 1.15.0.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandNo
schemas_onlyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so thoroughly: it discloses the truncation hazard, exact expected payload sizes for each mode, and the historical failure where the default exceeded the cap. It also tells the agent what each variant returns, so the response shape is predictable before invocation.

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 longer than average but every sentence earns its place: purpose is front-loaded, the mode breakdown is scannable, and the measured sizes directly support the truncation warning. The historical note about the previous default is relevant because it justifies the current default behavior.

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 tool with no annotations, no output schema, and only 0% parameter schema coverage, the description is complete: it covers purpose, when to use each variant, argument semantics, output size, and a known failure mode. Nothing an agent needs to call this tool correctly is missing.

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?

Schema description coverage is 0%, so the description must fully compensate, and it does: command is explained as 'return ONE schema body by name' and schemas_only is mapped to the CLI flag with concrete size consequences. Example calls like discover(command='run') make parameter usage unambiguous.

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 names the exact resource ('comfy-cli's self-describing command surface') with a clear verb ('Return'), and frames the tool as a runtime way to learn the CLI's contract rather than a generic discovery operation. It distinguishes the tool from siblings by tying it to the specific 'comfy discover' wrapper.

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?

It explicitly conveys when to use the tool ('at runtime instead of hard-coding it') and provides three concrete invocation modes with size and capability guidance. The warning that schemas_only=False is 'only for a client with a raised cap' effectively tells the agent when NOT to use that mode. This is unusually explicit usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.