Skip to main content
Glama
nbhson

Universal Prompt Gate MCP Server

by nbhson

Prompt Gate (user-confirmed)

review_and_select_prompt

Rewrites a prompt, then asks the user to pick the original, the rewrite, or cancel, returning only the approved version and never auto-selecting.

Instructions

Generates a rewritten version of the prompt, then asks the user to choose: use original, use rewritten, or cancel. Returns only the approved prompt. Cancellation is a distinct outcome and never exposes an approved prompt.

If the client does not support MCP elicitation, the tool returns a distinct "pending_user_selection" result: it shows both versions in plain text with the three numbered choices and asks the agent to re-call this tool with selection set to the user's choice ("original" / "rewritten" / "cancel"). Never auto-select.

CALLING GUIDE (for the LLM):

  • FIRST call (rewrite): pass prompt + context; do NOT pass selection. ALWAYS pass a short context (1-3 sentences) summarizing the conversation so far.

  • If the first call returns status "pending_user_selection": show the two versions to the user, ask which to use, then call again with the SAME inputs PLUS selection set to "original", "rewritten", or "cancel" matching the user's choice.

  • Choose rewrite_level to fit the task: light for quick one-shot answers, balanced (default) for most coding/research work, detailed when the user explicitly wants a fully-specified spec.

  • Pass language only when the user wants the rewritten prompt in a language different from the original. Do NOT switch the language on your own judgment — the server auto-detects the prompt language and preserves it by default.

Input Schema

NameRequiredDescriptionDefault
promptYesThe original prompt to review. This is the user's latest message only.
contextYes1-3 sentences summarizing the conversation/session so far (what the user has asked, what files/topics are in play, what was decided). STRONGLY RECOMMENDED: pass this on every call so the rewrite is grounded in prior context. Omit only for brand-new sessions with no history.
languageNoOutput language, e.g. "english" or "vietnamese". ONLY pass this when the user explicitly asks for a different output language. If the user has not asked, omit it — the server auto-detects the prompt's language and preserves it. Do NOT pass "english" just to "improve clarity"; that switches the output language and is a drift.
selectionNoONLY for the SECOND call of a pending_user_selection flow: the user's explicit choice after the server could not show an interactive picker. On the first call (rewrite) this must be omitted. Values: "original", "rewritten", "cancel". Never auto-select; pass it only after the user has chosen.
rewrite_levelNoHow much enrichment to apply. "light" = minimal; "balanced" (default) = add missing structure/context/criteria; "detailed" = full spec with acceptance criteria.
rewritten_promptNoONLY for the SECOND call of a pending_user_selection flow: the exact rewritten text the user saw in the first call's "pending_user_selection" result. Omit on the first call. When present with selection="rewritten", this is what gets approved — so the user approves exactly what they read, not a re-rewrite.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.3/5.0
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 does so well: it discloses the elicitation fallback, the `pending_user_selection` result shape, that cancellation is a distinct outcome that never yields an approved prompt, and that the server auto-detects and preserves language. These are exactly the behavioral traits an agent needs before calling.

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

Conciseness4/5

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

Front-loaded with the core purpose and outcome, then organized under a clear CALLING GUIDE heading. It is longer than typical but nearly every line carries routing or sequencing information; only mild repetition between the prose and the parameter notes.

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?

There is no output schema, so the description must describe returns — and it does: the approved prompt, the distinct `pending_user_selection` payload, and the cancellation outcome. For a six-parameter, two-phase tool with no annotations, nothing essential is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds calling-order semantics not obvious from the schema: which parameters belong to the first call versus the second, and the practical guidance that `light` suits one-shot answers while `detailed` is for full specs. This meaningfully extends the field descriptions.

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

Purpose4/5

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

States a specific two-step action (generate a rewritten prompt, then obtain user selection) and a precise scope: 'Returns only the approved prompt.' It distinguishes itself from a plain rewrite by making user confirmation the core behavior, though it never names the sibling `rewrite_prompt` to contrast against.

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

Usage Guidelines4/5

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

The CALLING GUIDE is unusually explicit about the first vs. second call, when to pass `selection`, when to omit it, and 'Never auto-select.' It also gives clear when-to-use rules for `rewrite_level` and `language`. The one gap is that it never routes the agent between this tool and the sibling `rewrite_prompt`.

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