update_prompt_version
Assign or remove a label for a specific prompt version. Use null to clear the label after looking up IDs with list_prompt_labels.
Instructions
Update a specific prompt version's label assignment. This only assigns or removes a label, and null clears the label after you look up ids with list_prompt_labels.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt_id | Yes | Prompt ID or slug | |
| version_id | Yes | Version UUID to update | |
| label_id | Yes | Label ID to assign to this version, or null to remove the label |
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 |
Implementation Reference
- src/services/prompts.service.ts:128-138 (handler)The actual handler/implementation of updatePromptVersion. It calls the underlying API via PUT to /prompts/{promptId}/versions/{versionId} with label_id data.
async updatePromptVersion( promptId: string, versionId: string, data: { label_id?: string | null }, ): Promise<{ success: boolean }> { await this.put( `/prompts/${this.encodePathSegment(promptId)}/versions/${this.encodePathSegment(versionId)}`, data, ); return { success: true }; } - src/tools/prompts.tools.ts:292-301 (schema)Zod schema defining the input parameters for update_prompt_version: prompt_id (string), version_id (string), label_id (nullable string).
updatePromptVersion: { prompt_id: z.string().describe("Prompt ID or slug"), version_id: z.string().describe("Version UUID to update"), label_id: z .string() .nullable() .describe( "Label ID to assign to this version, or null to remove the label", ), }, - src/tools/prompts.tools.ts:1065-1104 (registration)Registration of the 'update_prompt_version' tool on the MCP server using server.tool(), with schema and handler function that validates label_id and calls the service.
server.tool( "update_prompt_version", "Update a specific prompt version's label assignment. This only assigns or removes a label, and null clears the label after you look up ids with list_prompt_labels.", PROMPTS_TOOL_SCHEMAS.updatePromptVersion, async (params) => { if (params.label_id === undefined) { return { content: [ { type: "text" as const, text: "Error: label_id is required — pass a label ID to assign, or null to remove the label", }, ], isError: true, }; } await service.prompts.updatePromptVersion( params.prompt_id, params.version_id, { label_id: params.label_id, }, ); return { content: [ { type: "text", text: JSON.stringify( { message: `Successfully updated version "${params.version_id}" of prompt "${params.prompt_id}"`, success: true, }, null, 2, ), }, ], }; }, );