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 m...
AI agents use create_prompt to create or update resources in Portkey Admin — usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Portkey Admin environment.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name for the prompt |
model | string | — | Model identifier (e.g., 'gpt-4', 'claude-3-opus'). Required unless ai_model_id or finetune_id is provided |
tools | array | — | Tool definitions for tool use |
string | string | — | Legacy prompt template string. Use plain text for single-message prompts, or a JSON-encoded messages array string for multi-message chat prompts. |
dry_run | boolean | — | When true, validate without creating |
messages | array | — | Structured chat template alias. Serialized to the legacy string format before creation. |
functions | array | — | Function definitions for function calling |
parameters | object | Yes | Default values for template variables |
ai_model_id | string | — | AI model ID (alternative to model). Required unless model or finetune_id is provided |
finetune_id | string | — | Fine-tune ID (alternative to model). Required unless model or ai_model_id is provided |
tool_choice | object | — | Tool choice strategy |
virtual_key | string | Yes | Virtual key slug for model access |
Parameters from the server's own tool schema.
An AI agent can call create_prompt faster than any human can review — one bad instruction and it creates or modifies resources in Portkey Admin by the hundred, each call as confident as the last.
Risk signalsAccepts raw HTML/template content (messages[].content) · High parameter count (29 properties)
Attacks that exploit this kind of access
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. It is categorised as a Write tool in the Portkey Admin MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
create_prompt accepts 12 parameters: name, model, tools, string, dry_run, messages, functions, parameters, ai_model_id, finetune_id, tool_choice, virtual_key. Required: name, parameters, virtual_key. The full parameter table on this page comes from the server's own tool schema.
Register the Portkey Admin MCP server in PolicyLayer and add a rule for create_prompt: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Portkey Admin. Nothing to install.
create_prompt is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the create_prompt rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for create_prompt. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
create_prompt is provided by the Portkey Admin MCP server (CodesWhat/portkey-admin-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.