Skip to main content
Glama

create_prompt

Create a new prompt template with its first version, accepting 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
modelNoModel identifier (e.g., 'gpt-4', 'claude-3-opus'). Required unless ai_model_id or finetune_id is provided
toolsNoTool definitions for tool use
stringNoLegacy prompt template string. Use plain text for single-message prompts, or a JSON-encoded messages array string for multi-message chat prompts.
dry_runNoWhen true, validate without creating
messagesNoStructured chat template alias. Serialized to the legacy string format before creation.
functionsNoFunction definitions for function calling
parametersYesDefault values for template variables
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
tool_choiceNoTool choice strategy
virtual_keyYesVirtual key slug for model access
collection_idYesCollection ID to organize the prompt in (use list_collections to find)
is_raw_templateNoRender the stored template as a raw structural template
template_metadataNoCustom metadata (app, env, source_file, etc.)
version_descriptionNoDescription for this prompt version

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.11.5
    • addedInput schema / properties / is_raw_template
      Added value: +{
      +  "description": "Render the stored template as a raw structural template",
      +  "type": "boolean"
      +}
  2. Addedv1.0.1
  3. Removed
  4. First observed

TDQS

A4.6/5.0
Behavior4/5

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

With annotations already declaring readOnlyHint=false and idempotentHint=false, the description adds useful behavior: it creates a new version immediately and returns prompt id, slug, and version id. It does not contradict the annotations. It could add a bit more about side effects or validation behavior, but the key mutation semantics are covered.

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?

Four compact sentences, each earning its place: purpose, usage context, behavior, and parameter guidance. No filler or repetition of schema content.

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 tool with 16 parameters, nested objects, and an output schema, this description provides the critical orientation: what it creates, when to use it instead of migrate_prompt, how to handle message formats, and what it returns. It doesn't exhaustively explain every field, but the schema already does that. Minor missing context like dry_run behavior is covered by the schema, so the description is sufficiently complete.

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

Parameters4/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 meaningful clarification beyond the schema by explaining the relationship between plain text, structured messages, and the JSON-encoded string format, specifically preferring messages for multi-message chat prompts. This helps an agent choose between the two overlapping parameter options.

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 states a specific action ('Create a new prompt template and initial version') and clearly distinguishes it from migrate_prompt and update_prompt. It also names the resource and the immediate effect, so an agent can identify what this tool does without opening the schema.

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 says to use this for first-time setup and points to migrate_prompt for idempotent CI/CD flows. It also gives guidance on choosing between messages and string for multi-message prompts, which is practical invocation guidance beyond the schema.

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

Deploy Server

Other Tools