migrate_prompt
Create or update prompts idempotently for CI/CD with app and environment metadata. Dry-run option enables safe preflight checks.
Instructions
Create or update a prompt in one idempotent step for CI/CD and prompt-as-code flows. Finds existing prompts by name within the collection, stores app/env in template_metadata, and supports dry_run for safe preflight checks.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Prompt name to create or find for update | |
| app | Yes | App identifier (REQUIRED). Use your deployed app name, for example 'hourlink' or 'support-console'. | |
| env | Yes | Environment identifier (REQUIRED). Use your environment name, for example 'dev', 'staging', 'prod', or 'qa'. | |
| collection_id | Yes | Collection ID to search in and create under | |
| string | No | Legacy prompt template string with {{variable}} mustache syntax. | |
| messages | No | Structured chat template alias for migrations. Serialized to the legacy string format before the prompt is created or updated. | |
| parameters | Yes | Default values for template variables | |
| virtual_key | Yes | Virtual key slug for model access | |
| model | No | Model identifier | |
| version_description | No | Description for this version | |
| template_metadata | No | Additional custom metadata | |
| functions | No | Function definitions | |
| tools | No | Tool definitions | |
| tool_choice | No | Tool choice strategy | |
| dry_run | No | When true, only check what action would be taken without making changes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded and returned structured data | |
| data | No | Structured success payload when ok is true | |
| error | No | Structured error payload when ok is false |