Prompts
Create reusable prompt templates with variable substitution for your AI agents.
What are Prompts?
Prompts are reusable templates that define structured instructions for AI agents. They support variable substitution using Handlebars/Mustache syntax, allowing you to create flexible templates that can be filled with different values at runtime.
For example, a prompt template like Summarize the following {{topic}} in {{style}} style can be reused with different topics and styles without recreating the prompt each time.
Prompt Properties
Every prompt has the following properties:
| Property | Type | Description |
|---|---|---|
| id | string | Unique identifier (UUID), auto-generated |
| server_id | string | ID of the server this prompt belongs to |
| name | string | Unique name used to reference the prompt |
| description | string | Human-readable description of what the prompt does |
| template | string | The prompt template with Handlebars/Mustache variables |
| arguments | array | Array of argument definitions, each with name, description, and required |
Registering a Prompt
Register a new prompt template by sending a POST request:
curl -X POST https://api.agentdojo.dev/mcp/prompts \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "summarize-topic",
"description": "Summarize a given topic in a specified writing style",
"template": "Summarize the following {{topic}} in {{style}} style. Focus on key points and keep it concise.",
"arguments": [
{
"name": "topic",
"description": "The topic or subject to summarize",
"required": true
},
{
"name": "style",
"description": "The writing style (e.g., formal, casual, technical)",
"required": true
}
]
}'Response:
{
"id": "prompt_001",
"name": "summarize-topic",
"description": "Summarize a given topic in a specified writing style",
"template": "Summarize the following {{topic}} in {{style}} style. Focus on key points and keep it concise.",
"arguments": [
{ "name": "topic", "description": "The topic or subject to summarize", "required": true },
{ "name": "style", "description": "The writing style (e.g., formal, casual, technical)", "required": true }
]
}Listing Prompts
List all registered prompts:
curl -X POST https://api.agentdojo.dev/mcp/prompts/list \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json"Response:
{
"prompts": [
{
"name": "summarize-topic",
"description": "Summarize a given topic in a specified writing style",
"arguments": [
{ "name": "topic", "description": "The topic or subject to summarize", "required": true },
{ "name": "style", "description": "The writing style (e.g., formal, casual, technical)", "required": true }
]
}
]
}Getting a Prompt
Retrieve a prompt with its variables filled in by providing the prompt name and argument values:
curl -X POST https://api.agentdojo.dev/mcp/prompts/get \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "summarize-topic",
"arguments": {
"topic": "machine learning transformers",
"style": "technical"
}
}'Response:
{
"description": "Summarize a given topic in a specified writing style",
"messages": [
{
"role": "user",
"content": {
"type": "text",
"text": "Summarize the following machine learning transformers in technical style. Focus on key points and keep it concise."
}
}
]
}Via MCP Protocol
Prompts are also accessible through the standard MCP JSON-RPC protocol, which is how AI agents typically discover and use them.
prompts/list
{
"jsonrpc": "2.0",
"id": 1,
"method": "prompts/list"
}prompts/get
{
"jsonrpc": "2.0",
"id": 2,
"method": "prompts/get",
"params": {
"name": "summarize-topic",
"arguments": {
"topic": "machine learning transformers",
"style": "technical"
}
}
}Template Syntax
Prompt templates use Handlebars/Mustache syntax for variable substitution. Variables are enclosed in double curly braces.
Simple variable
Analyze the {{document_type}} and provide {{output_format}} output.Multiple variables
You are a {{role}} assistant. Help the user with {{task}} using a {{tone}} tone. Respond in {{language}}.Multi-line template
Review the following code:
Language: {{language}}
Context: {{context}}
Code:
{{code}}
Provide feedback on: {{focus_areas}}