Prompt Optimiser
Suggest improvements to a prompt for a chosen goal. Returns revised text, an explanation of changes and estimated clarity scores.
prompt-optimize Example
{
"changes_made": [
{
"change": "Added explicit role definition and system context",
"reasoning": "Clarifies the purpose and expected behavior, reducing ambiguity about what the prompt should accomplish"
},
{
"change": "Restructured vague input into clear task with specific output requirements",
"reasoning": "Provides measurable evaluation criteria rather than implicit expectations"
},
{
"change": "Added numbered output format expectations",
"reasoning": "Enables consistent, structured responses that can be programmatically evaluated"
},
{
"change": "Included meta-analysis request (confidence, limitations)",
"reasoning": "Makes the testing process more comprehensive and diagnostic for capability assessment"
}
],
"issues_found": [
"Extremely vague - unclear what should happen with 'test_value'",
"No explicit task definition or expected output format",
"Cannot be effectively evaluated or reproduced",
"No context for what 'automated capability testing' means",
"Insufficient for meaningful testing purposes"
],
"clarity_score": {
"improved": 9,
"original": 1
},
"improved_prompt": "You are an automated capability testing system. Process the following test input and provide structured feedback on your ability to handle it: 'test_value'. Return your analysis including: (1) successful parsing of the input, (2) any constraints or limitations encountered, (3) confidence level in handling this input type, and (4) recommendations for improvement.",
"techniques_applied": [
"Role-based prompting",
"Task decomposition with numbered steps",
"Explicit output structure definition",
"Context clarification",
"Meta-cognitive prompting for self-assessment"
],
"improved_token_estimate": 65,
"original_token_estimate": 2
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
bad_examples | array | No | — |
good_examples | array | No | — |
current_prompt | string | Yes | — |
task_description | string | No | — |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
changes_made | array | Always (present in every successful answer) |
clarity_score | object | Always (present in every successful answer) |
improved_prompt | string | Always (present in every successful answer) |
techniques_applied | array | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "prompt-optimize",
"inputs": {
"current_prompt": "test_value",
"task_description": "This is a test input for automated capability testing."
},
"max_price_cents": 15
}' {
"tool": "strale_execute",
"arguments": {
"slug": "prompt-optimize",
"inputs": {
"current_prompt": "test_value",
"task_description": "This is a test input for automated capability testing."
},
"max_price_cents": 15
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "prompt-optimize",
inputs: {
"current_prompt": "test_value",
"task_description": "This is a test input for automated capability testing."
},
max_price_cents: 15,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="prompt-optimize",
inputs={
"current_prompt": "test_value",
"task_description": "This is a test input for automated capability testing.",
},
max_price_cents=15,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i -X POST https://api.strale.io/x402/v2/prompt-optimize \
-H 'Content-Type: application/json' \
-d '{
"current_prompt": "test_value",
"task_description": "This is a test input for automated capability testing."
}' Limitations
Suggestions can work differently across models
Optimisation suggestions are model-agnostic — some techniques work better with specific AI providers
What to do instead: Test optimised prompts against your target model and iterate based on actual output quality
Output size cap per call
The improved prompt and its analysis must fit within an output limit that scales with input size, up to 8,000 tokens. Requests exceeding that limit are refused rather than returned truncated, and an identical retry does not help.
What to do instead: Shorten the prompt and retry
Related tools
- Code Review €0.20
- LLM Output Validation €0.05