update_prompt_label
Update a prompt label's name, description, or color. Changes apply instantly to all versions tagged with the label, without reassigning labels or altering history.
Instructions
Update a prompt label's name, description, or color only, unlike update_prompt_version which changes which label a version carries. This takes effect immediately for all versions already tagged with the label, but does not reassign labels or touch history; use list_prompt_labels to find the label_id first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label_id | Yes | Label ID to update | |
| name | No | New name for the label | |
| description | No | New description | |
| color_code | No | New hex color code (e.g., '#FF5733') |
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/tools/labels.tools.ts:183-207 (handler)The MCP tool handler for 'update_prompt_label'. Extracts label_id from params, calls service.labels.updateLabel(), and returns a success message.
// Update label tool server.tool( "update_prompt_label", "Update a prompt label's name, description, or color only, unlike update_prompt_version which changes which label a version carries. This takes effect immediately for all versions already tagged with the label, but does not reassign labels or touch history; use list_prompt_labels to find the label_id first.", LABELS_TOOL_SCHEMAS.updatePromptLabel, async (params) => { const { label_id, ...updateData } = params; await service.labels.updateLabel(label_id, updateData); return { content: [ { type: "text", text: JSON.stringify( { message: `Successfully updated label "${label_id}"`, success: true, }, null, 2, ), }, ], }; }, ); - src/tools/labels.tools.ts:52-61 (schema)Zod schema defining input parameters for update_prompt_label: label_id (required), name, description, and color_code (all optional).
updatePromptLabel: { label_id: z.string().describe("Label ID to update"), name: z.string().optional().describe("New name for the label"), description: z.string().optional().describe("New description"), color_code: z .string() .regex(/^#[0-9A-Fa-f]{6}$/) .optional() .describe("New hex color code (e.g., '#FF5733')"), }, - src/tools/labels.tools.ts:183-207 (registration)Registration of the tool via server.tool() within the registerLabelsTools() function, which is exported and called from src/tools/index.ts.
// Update label tool server.tool( "update_prompt_label", "Update a prompt label's name, description, or color only, unlike update_prompt_version which changes which label a version carries. This takes effect immediately for all versions already tagged with the label, but does not reassign labels or touch history; use list_prompt_labels to find the label_id first.", LABELS_TOOL_SCHEMAS.updatePromptLabel, async (params) => { const { label_id, ...updateData } = params; await service.labels.updateLabel(label_id, updateData); return { content: [ { type: "text", text: JSON.stringify( { message: `Successfully updated label "${label_id}"`, success: true, }, null, 2, ), }, ], }; }, ); - src/services/labels.service.ts:84-92 (helper)Service layer method that sends a PUT request to /labels/{labelId} with the updated fields.
async updateLabel( labelId: string, data: UpdateLabelRequest, ): Promise<UpdateLabelResponse> { return this.put<UpdateLabelResponse>( `/labels/${this.encodePathSegment(labelId)}`, data, ); } - src/services/labels.service.ts:45-49 (helper)TypeScript interface for the update label request payload.
export interface UpdateLabelRequest { name?: string; description?: string; color_code?: string; }