optimize_prompt
Rewrite rough prompt drafts into structured, optimized versions using a local LLM, saving tokens and improving output quality before sending to paid APIs.
Instructions
Optimizes a rough prompt draft using a local LLM before sending it to a paid API
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| draft | Yes | The raw draft idea | |
| model | No | Override for the model | |
| engine | No | The underlying LLM engine to use (ollama or anthropic) | |
| context | No | Optional background/domain context (project description, glossary, relevant facts) to help the model correctly interpret domain-specific terms in the draft | |
| explain | No | When true, includes a 1-line summary of what the critic pass changed, as a second content block | |
| auto_cot | No | Automatically inject Chain-of-Thought (CoT) instructions if the task is complex. | |
| brainstorm | No | When true, instructs the target model to generate multiple personas/perspectives for open-ended brainstorming | |
| session_id | No | Optional ID to maintain conversation state. Provide a unique string. When making tweaks to a previously generated prompt, pass the same session_id. | |
| show_stats | No | Show a token count and prompt efficiency analysis. | |
| interactive | No | When true, instructs the calling assistant to pause and ask for user approval before answering the optimized prompt. Defaults to true to allow iteration. | |
| target_model | No | The target API/format this prompt will be sent to | generic |
| auto_guardrails | No | Automatically generate and inject negative constraints (anti-hallucination guardrails). |