Skip to main content
Glama
xXMSGXx
by xXMSGXx

refine_prompt

Improve AI prompts by applying targeted feedback to enhance clarity, specificity, and model compatibility while preserving original structure and project context.

Instructions

Iteratively improve an existing prompt based on specific feedback.

Use this tool when you need to: • Improve a prompt that didn't get good results • Add missing context or constraints • Make a prompt more specific or clearer • Adapt a prompt for a different AI model

The tool preserves the original structure while applying targeted improvements.

IMPORTANT: When available, pass workspace context (file structure, package.json, tech stack) to ensure refined prompts comply with the user's project scope and original request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesThe current prompt to refine.
feedbackYesWhat should be improved. Examples: "make it more specific", "add error handling requirements", "focus on performance".
preserveStructureNoWhether to keep the original structure. Default: true.
targetModelNoTarget AI model for optimization.
workspaceContextNoProject context to ensure the refined prompt aligns with the codebase. Include: file/folder structure, package.json dependencies, tech stack (React, Node, etc.), relevant code snippets, and the original user request. This ensures the refined prompt complies with project conventions and scope.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: it's an iterative improvement tool, preserves original structure by default, and requires workspace context for project compliance. However, it doesn't mention potential side effects like rate limits or authentication needs.

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 well-structured and front-loaded with the core purpose, followed by usage guidelines and important context. Every sentence earns its place: the first states the purpose, the bulleted list provides clear usage scenarios, and the IMPORTANT section adds necessary project-specific guidance without redundancy.

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

Completeness4/5

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

For a 5-parameter tool with no annotations and no output schema, the description provides good contextual completeness with clear purpose, usage guidelines, and behavioral context. It could be improved by mentioning what the refined prompt output looks like or any limitations, but covers most essential aspects well.

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 100%, so the baseline is 3. The description adds some value by explaining workspace context usage ('ensure refined prompts comply with project scope') and mentioning structure preservation, but doesn't provide significant additional parameter semantics beyond what's already documented in the 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's purpose with specific verbs ('iteratively improve', 'refine') and resources ('existing prompt'), distinguishing it from siblings like analyze_prompt (analysis) and generate_prompt (creation). It explicitly mentions applying targeted improvements based on feedback.

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 provides explicit when-to-use guidance with four bulleted scenarios (e.g., 'Improve a prompt that didn't get good results', 'Adapt a prompt for a different AI model'), clearly differentiating from sibling tools. It also includes an IMPORTANT section about when to pass workspace context.

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