Skip to main content
Glama

create_prompt

Create a new prompt template and initial version. Accepts plain text or structured chat messages, returns prompt id, slug, and version id.

Instructions

Create a new prompt template and initial version. Use this for first-time setup; use migrate_prompt for idempotent CI/CD flows. Accepts plain text or structured chat messages, creates a new version immediately, and returns the prompt id, slug, and version id. For multi-message chat prompts pass messages (preferred) or a JSON-encoded array as string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesDisplay name for the prompt
collection_idYesCollection ID to organize the prompt in (use list_collections to find)
stringNoLegacy prompt template string. Use plain text for single-message prompts, or a JSON-encoded messages array string for multi-message chat prompts.
messagesNoStructured chat template alias. Serialized to the legacy string format before creation.
parametersYesDefault values for template variables
virtual_keyYesVirtual key slug for model access
modelNoModel identifier (e.g., 'gpt-4', 'claude-3-opus'). Required unless ai_model_id or finetune_id is provided
ai_model_idNoAI model ID (alternative to model). Required unless model or finetune_id is provided
finetune_idNoFine-tune ID (alternative to model). Required unless model or ai_model_id is provided
version_descriptionNoDescription for this prompt version
template_metadataNoCustom metadata (app, env, source_file, etc.)
functionsNoFunction definitions for function calling
toolsNoTool definitions for tool use
tool_choiceNoTool choice strategy
dry_runNoWhen true, validate without creating

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the tool call succeeded and returned structured data
dataNoStructured success payload when ok is true
errorNoStructured error payload when ok is false
Behavior4/5

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

Description adds behavioral context beyond annotations: it creates a version immediately and returns ids. Annotations already indicate non-readonly, non-destructive, non-idempotent, so no contradiction. Some specifics like 'creates a new version immediately' are helpful but not exhaustive.

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?

Three sentences are compact and front-loaded with purpose, then usage guidance, then parameter details. Every sentence adds unique value with no redundancy.

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

Completeness5/5

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

Given the complexity (15 parameters, nested objects), the description covers core workflow, tool selection, parameter guidance, and return values. Output schema exists, so return details are sufficient. No gaps for an AI agent.

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

Parameters5/5

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

Despite 100% schema coverage, description adds valuable meaning: distinguishes between 'string' (legacy) and 'messages' (structured), recommends 'messages' for multi-message prompts, and explains that messages are serialized. This aids correct parameter selection beyond 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?

Description clearly states 'Create a new prompt template and initial version' and distinguishes from sibling 'migrate_prompt' for CI/CD flows. The verb 'create' with resource 'prompt template' is specific and unambiguous.

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?

Explicitly advises use for first-time setup versus migrate_prompt for idempotent flows. Also explains when to use plain text vs structured messages, providing clear context for parameter selection.

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/s-b-e-n-s-o-n/portkey-admin-mcp'

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