Skip to main content
Glama
LumabyteCo

Clarifyprompt-MCP

compose_prompt

Run an automated pipeline that clarifies, optimizes or grounds with sources, critiques, and auto-revises a prompt in a single call. Handles clarification questions and source grounding.

Instructions

Run the canonical ClarifyPrompt pipeline in ONE call: clarify (optional pre-stage) → ground OR optimize (core) → critique (optional post-stage) → optional auto-revise. Use this when you want the four-tool happy path without orchestrating five round-trips. Short-circuits if pre_clarify surfaces questions — caller answers and re-calls. When sources is non-empty the chain takes the strict ground_prompt branch; otherwise it goes through optimize_prompt. When auto_revise is true and critique returns a non-accept verdict with an improved rewrite, final_prompt is the rewrite. The stages array is a per-call audit log so callers can see exactly what ran.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesThe prompt to compose.
pre_clarifyNo'auto' = run clarify only if analyzer confidence is low / prompt is short. 'always' = force clarify. 'never' = skip. When clarification questions surface, the chain stops; caller answers and re-calls.auto
max_questionsNo
sourcesNoWhen non-empty, the chain takes the strict ground_prompt branch (caller-provided sources pinned at highest priority).
post_critiqueNoRun the critique judge against the optimized output. Adds ~3-5s on a local model.
revise_thresholdNo
critique_criteriaNoOverride the default 5 critique criteria.
auto_reviseNoWhen true AND post_critique is true AND verdict !== 'accept' AND there's an improvedPrompt: `final_prompt` becomes the rewritten version instead of the raw optimization.
max_iterationsNoMax revise-loop iterations. With `auto_revise: true` AND `post_critique: true`, the engine can feed each iteration's improvedPrompt back through optimize+critique up to this cap. Stops early at verdict=accept or when there's no improvedPrompt. Default 1 (single-shot, no loop). Hard max 5 to prevent cost runaways.
clarify_modelNoOverride the LLM model for the clarify pre-stage. Default: env LLM_MODEL. Useful for per-stage cost/quality routing — e.g. run clarify on a cheap model while critique runs on a frontier one.
optimize_modelNoOverride the LLM model for the optimize/ground core stage.
critique_modelNoOverride the LLM model for the critique judge AND rewrite.
categoryNo
platformNo
modeNo
enrich_contextNo
session_idNo
file_pathNo
file_languageNo
file_excerptNo
cwdNo
user_localeNo
user_pinned_instructionsNo
skip_intent_resolutionNo
include_bundleNo
Behavior4/5

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

With no annotations, the description carries full burden. It details the pipeline flow, short-circuit behavior, branch conditions, and auto-revise loop. It mentions stages as an audit log and cost limits (max_iterations). However, it lacks disclosure on potential side effects, auth needs, or rate limits.

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?

The description is a single paragraph that front-loads the purpose and then explains behaviors. It is dense but efficient for the complexity. Could be improved with bullet points for scannability, but remains concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 25 parameters, 40% schema coverage, and no output schema, the description falls short. It does not describe the output structure (e.g., final_prompt, stages) nor error conditions. Many contextual parameters (session_id, file_path, etc.) are undocumented, leaving gaps for an AI agent.

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

Parameters3/5

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

Schema description coverage is 40%, so the description must compensate. It adds value for core parameters (pre_clarify, sources, post_critique, auto_revise, max_iterations, model overrides) explaining their behavior. However, many parameters (category, platform, mode, file_path, etc.) are not described, relying solely on schema.

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 tool runs the canonical ClarifyPrompt pipeline in one call, covering clarify, ground/optimize, critique, and auto-revise. It distinguishes from sibling tools by explicitly noting it replaces orchestrating five round-trips. The branching based on sources (ground vs optimize) is also specified.

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 description explains when to use the tool: when wanting the four-tool happy path without orchestrating. It covers short-circuit behavior for pre_clarify, branching conditions, and auto-revise. However, it does not explicitly state when not to use it (e.g., for fine-grained control, use individual tools), though this is implied.

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/LumabyteCo/clarifyprompt-mcp'

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