update_prompt_partial
Update a prompt partial by creating a new version with modified content or metadata; changes remain inactive until published.
Instructions
Create a new version of a partial by updating its content or metadata. Only provided fields change, and the new version stays inactive until publish_partial makes it current.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt_partial_id | Yes | Prompt partial ID or slug to update | |
| name | No | New display name for the partial | |
| string | No | New content for the partial | |
| description | No | Description for this version | |
| status | No | New status for the partial |
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/partials.service.ts:47-63 (handler)Core handler that executes the update prompt partial logic: calls PUT /prompts/partials/{id} with the request body, remapping 'description' to 'version_description' for API compatibility.
async updatePromptPartial( promptPartialId: string, data: UpdatePromptPartialRequest, ): Promise<UpdatePromptPartialResponse> { // Portkey API inconsistency: POST /prompts/partials accepts "description" // in the response as "description", but PUT expects "version_description" // for the same field. Remap here for consistency. const { description, ...rest } = data; const body: Record<string, unknown> = { ...rest }; if (description !== undefined) { body.version_description = description; } return this.put<UpdatePromptPartialResponse>( `/prompts/partials/${this.encodePathSegment(promptPartialId)}`, body, ); } - src/services/partials.types.ts:69-75 (schema)Input type (UpdatePromptPartialRequest) and output type (UpdatePromptPartialResponse) for the update prompt partial operation.
export interface UpdatePromptPartialRequest { name?: string; string?: string; /** Version description — remapped to version_description before sending to API */ description?: string; status?: string; } - src/tools/partials.tools.ts:33-44 (schema)Zod schema definitions for the update_prompt_partial tool input parameters (prompt_partial_id, name, string, description, status).
updatePromptPartial: { prompt_partial_id: z .string() .describe("Prompt partial ID or slug to update"), name: z.string().optional().describe("New display name for the partial"), string: z.string().optional().describe("New content for the partial"), description: z.string().optional().describe("Description for this version"), status: z .enum(["active", "archived"]) .optional() .describe("New status for the partial"), }, - src/tools/partials.tools.ts:169-196 (registration)Registration of the 'update_prompt_partial' tool using server.tool(), binding the schema and handler that calls the service.
// Update partial tool server.tool( "update_prompt_partial", "Create a new version of a partial by updating its content or metadata. Only provided fields change, and the new version stays inactive until publish_partial makes it current.", PARTIALS_TOOL_SCHEMAS.updatePromptPartial, async (params) => { const { prompt_partial_id, ...updateData } = params; const result = await service.partials.updatePromptPartial( prompt_partial_id, updateData, ); return { content: [ { type: "text", text: JSON.stringify( { message: `Successfully updated prompt partial "${prompt_partial_id}"`, prompt_partial_version_id: result.prompt_partial_version_id, }, null, 2, ), }, ], }; }, );