migrate_prompt
Idempotently migrate prompts by name within a collection: creates new prompts, adds versions on content change, skips if unchanged. Dry run reports actions without making changes.
Instructions
Create or update a prompt in one idempotent step for CI/CD and prompt-as-code flows, unlike create_prompt which always makes a new prompt. Looks up the prompt by name within collection_id: if missing it creates the prompt, if found with different content it adds a new version (nothing is overwritten), and if the content already matches it no-ops; dry_run reports what would happen without changing anything. Stores app/env in template_metadata; get collection_id from list_collections. Returns the action taken (created, updated, or unchanged), dry_run flag, message, prompt id, slug, and version id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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'. | |
| name | Yes | Prompt name to create or find for update | |
| model | No | Model identifier | |
| tools | No | Tool definitions | |
| string | No | Legacy prompt template string with {{variable}} mustache syntax. | |
| dry_run | No | When true, only check what action would be taken without making changes | |
| messages | No | Structured chat template alias for migrations. Serialized to the legacy string format before the prompt is created or updated. | |
| functions | No | Function definitions | |
| parameters | Yes | Default values for template variables | |
| tool_choice | No | Tool choice strategy | |
| virtual_key | Yes | Virtual key slug for model access | |
| collection_id | Yes | Collection ID to search in and create under | |
| template_metadata | No | Additional custom metadata | |
| version_description | No | Description for this version |
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 |