Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
label_idYesLabel ID to update
nameNoNew name for the label
descriptionNoNew description
color_codeNoNew hex color code (e.g., '#FF5733')

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

  • 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,
    					),
    				},
    			],
    		};
    	},
    );
  • 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')"),
    },
  • 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,
    					),
    				},
    			],
    		};
    	},
    );
  • 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,
    	);
    }
  • TypeScript interface for the update label request payload.
    export interface UpdateLabelRequest {
    	name?: string;
    	description?: string;
    	color_code?: string;
    }
Behavior5/5

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

Annotations are basic (non-readonly, non-destructive). The description adds that changes take effect immediately for all tagged versions and do not reassign labels or touch history, offering valuable behavioral context beyond annotations.

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?

Two sentences, front-loaded with purpose, followed by behavioral notes and prerequisite. No redundant information; every phrase adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 4 parameters (1 required) and an output schema, the description covers immediate effects, side effects, and prerequisite steps. No gaps given the tool's simplicity.

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

Parameters4/5

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

Schema coverage is 100% with descriptions. The description reinforces that only name, description, or color can be updated, adding operational context. While not adding new parameter details, it clarifies mutation scope.

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 'Update a prompt label's name, description, or color only', specifying the verb and resource. It distinguishes from sibling update_prompt_version, which changes label assignments, making the purpose unambiguous.

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?

Explicitly contrasts with update_prompt_version and advises using list_prompt_labels to find the label_id first, providing clear when-to-use and prerequisite instructions.

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