Skip to main content
Glama

Interactive Feedback (人机协作反馈)

interactive_feedback

Requests human feedback through a web interface, blocking AI execution until the user provides input, approval, or clarification.

Instructions

Ask the human user for interactive feedback through the Web UI.

Use this tool whenever you need a human decision, clarification, confirmation, plan approval, design review, or final sign-off before continuing — especially when the next step has multiple valid approaches, irreversible side effects, or significant trade-offs.

Behavior:

  • Renders the resolved message (Markdown) and an optional list of options in a Web UI; the user submits text + selected options + optional images.

  • The call blocks until the user submits, the auto-resubmit countdown expires, or the configured backend timeout is reached.

  • On success, returns a list of MCP content blocks (text + image) that include the user reply, selected options, and an optional prompt suffix.

  • On parameter validation failure, raises ToolError so the agent can retry with corrected arguments. On service / task failure, returns a configurable resubmit prompt instructing the agent to call this tool again, instead of silently dropping the request.

Cross-tool compatibility:

  • summary / prompt are accepted as aliases for message so the same mcp.json config can target other feedback MCP variants without retraining the agent.

  • options is an alias for predefined_options.

  • project_directory, submit_button_text, timeout, timeout_seconds, feedback_type, priority, language, tags, user_id, task_id are accepted but ignored. They prevent the first-call validation failures observed when an agent reuses arguments shaped for a different feedback MCP server.

Note: this function is not the MCP registration site itself; server.py wraps it with mcp.tool() to expose it to MCP clients.

R25.2: 函数体首行 import httpx 让下面 except httpx.HTTPError 在运行时 解析符号——本工具被 MCP 客户端首次调用时一次性付 ~55 ms 加载费,而 MCP server cold-start 路径完全不会进入此函数(server.py 顶层 import 时只是定义而已)。

R44 FastMCP 最佳实践:ctx 关键字参数(FastMCP 自动注入)让本函数可以走 await _emit_ctx_info(ctx, ...) 把 task lifecycle 事件回送给 client (Cursor / Claude Desktop / ChatGPT Desktop)。client 收到后会在 chat sidebar 渲染一行进度日志,让人类用户能"看到工具确实在工作、正在等真人 回复",而不是猜"agent 是不是 hung 住了"。ctx 永远 keyword-only 且 默认 None,所以本工具被通过别的入口(pytest 直接调)调用时不会因为缺 ctx 而崩;具体安全语义见 _emit_ctx_info 的 docstring。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNoAccepted for compatibility; ignored by this server.
promptNoCompatibility alias for `message`. Ignored when `message` is provided.
loop_idNoLoop engineering: optional stable identifier shared by every feedback round that belongs to the same goal / outer loop (agent-chosen, e.g. 'auth-refactor-2026-07'). Rounds that carry the same loop_id are grouped in the UI so the human reviewer can replay 'which rounds did this objective go through, and what was decided each time'. Length: clamped to 64 characters server-side. Omit for standalone one-shot questions (default behavior unchanged).
messageNoQuestion, summary, or proposal to display to the human user. MUST be a non-empty string. Supports CommonMark / GitHub-Flavored Markdown (headings, lists, tables, fenced code blocks, links, inline code). Recommended length: 1-2000 characters; soft cap 1,000,000 characters (~1 MB UTF-8, R166); inputs longer than the cap are truncated with a trailing ellipsis marker. Best practices: (1) state the question clearly in the first line; (2) include the recommended/default answer when proposing options; (3) escape special characters properly in JSON (use \" for quotes, \n for newlines). If omitted, the server falls back to `summary` or `prompt` for cross-tool compatibility.
optionsNoCompatibility alias for `predefined_options`. Ignored when `predefined_options` is provided.
summaryNoCompatibility alias for `message` (used by noopstudios/Minidoracat interactive-feedback-mcp variants). Ignored when `message` is provided.
task_idNoAccepted for compatibility (some agents pre-generate a trace ID and pass it through); this server always auto-generates an internal task ID and ignores the externally supplied value. Useful when the same `mcp.json` config also points at MCP variants that *do* honour an externally supplied task ID.
timeoutNoAccepted for compatibility; this server uses its own configured backend timeout and auto-resubmit countdown.
user_idNoAccepted for compatibility; ignored by this server.
languageNoAccepted for compatibility; UI language follows the user's saved settings.
priorityNoAccepted for compatibility; ignored by this server.
loop_phaseNoLoop engineering: optional free-form phase tag for this round, e.g. 'investigate' / 'implement' / 'verify' / 'review'. Helps the reviewer see where in the inner loop the agent currently is. Length: clamped to 32 characters server-side.
header_labelNoOptional short chip / tag rendered above the prompt in the task pane to give a one-word context cue (e.g. 'Auth', 'DB', 'Layout', 'CSS', 'i18n'). Length: clamped to 16 characters server-side; single-word recommendation, no spaces if avoidable. Especially useful in multi-task mode where the user juggles 3+ concurrent feedback requests — the chip lets them visually distinguish task domains at a glance. If omitted or empty, no chip is shown (default existing layout). (mining-cycle-3 §2.1 — borrowed from gemini-cli ``ask_user.header`` schema.)
feedback_typeNoAccepted for compatibility; ignored by this server.
question_typeNoOptional UI mode hint: when ``'yesno'``, the frontend hides the free-text textarea and renders a single-row Yes/No button pair. User's click submits the literal string 'yes' or 'no' as the feedback result — saves typing + Submit-button click for binary decisions (approve/reject, proceed/abort, etc.). Allowed values: ``'yesno'`` (current) or ``None`` (default: keep textarea + optional ``predefined_options`` checkboxes). Unknown values silently treated as None (forward-compat for future types like ``'choice'`` / ``'rating'`` once the frontend supports them). (mining-cycle-3 §2.1 — borrowed from gemini-cli ``ask_user`` schema.)
loop_objectiveNoLoop engineering: optional one-sentence description of the loop's goal (e.g. 'Migrate auth/session.py to PyJWT 2.x with green integration tests'). Pass it on the first round of a loop_id; later rounds may omit it. Shown to the reviewer as loop context above the prompt. Length: clamped to 500 characters server-side.
iteration_labelNoLoop engineering: optional round label such as 'iter-3' or 'attempt-2'. Shown with the loop context so multiple rounds of the same loop are distinguishable at a glance. Length: clamped to 32 characters server-side.
timeout_secondsNoCompatibility alias for `timeout` (used by some MCP clients that explicitly suffix the unit). Both fields are accepted for compatibility — this server ignores them and uses its own configured backend timeout / auto-resubmit countdown. When both are provided, this server logs a debug line and discards both, since neither overrides server config.
success_criteriaNoLoop engineering: optional verifiable completion criteria the human should judge the evidence against (e.g. 'pytest all green + no new ruff warnings + docs regenerated'). Rendered alongside the loop context so the verdict is made against an explicit baseline. Length: clamped to 500 characters server-side.
project_directoryNoAccepted for compatibility with other feedback MCP variants; this server ignores it (project context is taken from the running Web UI / config).
predefined_optionsNoOptional list of predefined choices the user can pick from (rendered as multi-select checkboxes alongside a free-text reply). Two canonical input shapes (v1.6.0+ — the legacy parallel-array shape `predefined_options_defaults` was removed in R167; use the dict form below to mark recommended options): (a) **RECOMMENDED** list[dict] of shape {"label": str, "default": bool} — mark the recommended option with `default: true` so the UI shows a pre-checked checkbox (field aliases accepted: "label"/"text"/"value", "default"/"selected"/"checked"); (b) list[str] — simple labels, all initially unchecked (use this when no recommendation is needed). Non-string and non-{label,...} items are silently dropped. Each option max length: 10000 characters (longer items truncated). Tips: (1) keep options short, action-oriented and mutually distinguishable; (2) PREFER the dict form for ANY recommended option — `{"label": "Apply", "default": true}`. The UI renders real pre-checked checkboxes, so do NOT use text-prefix hacks (adding marker words to the label) for marking recommendations; (3) the user may also ignore options and reply with free text. If omitted, the server falls back to `options` for cross-tool compatibility.
submit_button_textNoAccepted for compatibility; this server uses its own UI labels.
feedback_placeholderNoOptional textarea placeholder hint shown to the user when waiting for free-text feedback. Per-task override of the global ``page.feedbackPlaceholder`` i18n string. Examples: 'Paste the error stack trace', 'Describe the visual glitch', 'Reply 'ok' to approve or 'no' + reason to reject'. Length: clamped to 200 characters server-side (single-line placeholders only; longer text is silently truncated; the response includes ``placeholder_truncated: true`` + ``placeholder_original_length`` + ``placeholder_max_length`` when clamping activates so callers can warn). If omitted or empty, the UI uses its default i18n placeholder. (mining-cycle-3 §2.1 — borrowed from gemini-cli ``ask_user`` schema.)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The description extensively explains behavior beyond annotations: blocks until user submits, returns MCP content blocks, raises ToolError on validation, and documents accepted/ignored parameters for cross-tool compatibility. Annotations (readOnlyHint=false, etc.) are consistent with the description; no contradiction.

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

Conciseness2/5

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

The description is excessively long and includes internal implementation details (import statement, cold-start cost, FastMCP context injection, Python code comments). These are not essential for an AI agent selecting or invoking the tool. The structure is organized, but the verbosity reduces conciseness.

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 (23 optional parameters, aliases, loop engineering features, output behavior), the description is remarkably complete. It covers expected behavior, parameter interactions, error handling, and output format. No gaps are apparent.

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 schema coverage is 100%, the description adds significant value by explaining aliases, ignored parameters, best practices (e.g., 'prefer the dict form for predefined_options'), truncation behavior, and loop engineering semantics. This goes far beyond the schema's basic 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 clearly states the verb ('Ask the human user for interactive feedback') and the resource ('through the Web UI'). It lists multiple specific use cases (decision, clarification, confirmation, plan approval, design review, final sign-off), making the purpose unmistakable. No siblings exist, so differentiation is not needed.

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 tells when to use the tool: 'whenever you need a human decision... especially when the next step has multiple valid approaches, irreversible side effects, or significant trade-offs.' This is concrete and actionable. It does not discuss when not to use, but given the lack of siblings, the guidance is sufficient.

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/XIADENGMA/ai-intervention-agent'

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