Skip to main content
Glama

publish_prompt

Make a specific prompt version the active default, instantly routing all callers to that version. Verify the version beforehand since no rollback is possible.

Instructions

Publish a specific version of a prompt as the active default, unlike promote_prompt which copies across environments or update_prompt which creates a new draft. This immediately routes all callers using the slug to that version and there is no rollback, so use list_prompt_versions to pick the version and update_prompt first if you need to create new content before promoting it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prompt_idYesPrompt ID or slug to publish
versionYesVersion number to publish as the default

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

Implementation Reference

  • MCP tool handler for 'publish_prompt'. Registers the tool with server.tool(), validates input via PROMPTS_TOOL_SCHEMAS.publishPrompt, calls service.prompts.publishPrompt() with prompt_id and version, returns a success JSON response.
    // Publish prompt tool
    server.tool(
    	"publish_prompt",
    	"Publish a specific version of a prompt as the active default, unlike promote_prompt which copies across environments or update_prompt which creates a new draft. This immediately routes all callers using the slug to that version and there is no rollback, so use list_prompt_versions to pick the version and update_prompt first if you need to create new content before promoting it.",
    	PROMPTS_TOOL_SCHEMAS.publishPrompt,
    	async (params) => {
    		await service.prompts.publishPrompt(params.prompt_id, {
    			version: params.version,
    		});
    		return {
    			content: [
    				{
    					type: "text",
    					text: JSON.stringify(
    						{
    							message: `Successfully published version ${params.version} of prompt "${params.prompt_id}"`,
    							prompt_id: params.prompt_id,
    							published_version: params.version,
    							success: true,
    						},
    						null,
    						2,
    					),
    				},
    			],
    		};
    	},
    );
  • Input schema for publish_prompt tool: requires prompt_id (string) and version (positive number, coerced from string).
    publishPrompt: {
    	prompt_id: z.string().describe("Prompt ID or slug to publish"),
    	version: z.coerce
    		.number()
    		.positive()
    		.describe("Version number to publish as the default"),
    },
  • Type definitions for PublishPromptRequest (version: number) and PublishPromptResponse (empty object).
    // ===== Publish Prompt (Make Default) =====
    
    export interface PublishPromptRequest {
    	version: number;
    }
    
    export type PublishPromptResponse = Record<string, never>;
  • Service method that sends PUT /prompts/{promptId}/makeDefault with the version payload to publish a prompt version as the default.
    async publishPrompt(
    	promptId: string,
    	data: PublishPromptRequest,
    ): Promise<PublishPromptResponse> {
    	return this.put<PublishPromptResponse>(
    		`/prompts/${this.encodePathSegment(promptId)}/makeDefault`,
    		data,
    	);
    }
  • Server instructions reference publish_prompt in the prompt workflow documentation string.
    const PACKAGE_VERSION = readPackageVersion();
    const SERVER_INSTRUCTIONS =
    	"Portkey Admin API server. Use list_* tools for discovery and get_* tools for details. " +
    	"Analytics tools require time_of_generation_min/max. " +
    	"Prompt workflows: create_prompt -> publish_prompt. " +
    	"Always validate_completion_metadata before run_prompt_completion. " +
    	"If the server is configured with only some domains, stay within that subset instead of assuming every Portkey admin tool is available.";
    
    function parseConfiguredToolDomains(
    	rawValue: string | undefined = process.env.PORTKEY_TOOL_DOMAINS?.trim() ||
    		process.env.MCP_TOOL_DOMAINS?.trim(),
    ): ToolDomain[] | undefined {
    	if (!rawValue) {
    		return undefined;
Behavior4/5

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

Annotations only indicate non-read-only and non-destructive. The description adds crucial behavioral context: immediate routing of all callers and no rollback possibility. This is essential for understanding the irreversible impact.

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?

The description is concise: three sentences that front-load the core action, contrast with siblings, explain impact, and give a recommended workflow. No unnecessary words.

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?

The description explains the effect, irreversibility, and workflow. It complements the existing schema and annotations well. Could optionally mention error conditions or prerequisites, but given the output schema exists and annotations are adequate, it is sufficiently complete.

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

Parameters3/5

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

The input schema covers 100% of parameter descriptions. The description does not add further detail about the parameters themselves but provides contextual usage advice ('use list_prompt_versions to pick the version'). Baseline 3 is appropriate.

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 clearly states the tool's purpose: 'Publish a specific version of a prompt as the active default'. It also distinguishes itself from sibling tools 'promote_prompt' and 'update_prompt', making the action unmistakable.

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?

The description provides explicit when-to-use guidance by contrasting with 'promote_prompt' and 'update_prompt'. It also advises a workflow: use 'list_prompt_versions' to pick the version and 'update_prompt' if new content is needed before publishing.

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