update_feedback
Update an existing feedback record by ID, changing only its value, weight, and metadata while keeping trace linkage immutable.
Instructions
Update an existing feedback record by ID. Returns the updated status and feedback IDs, changes only value, weight, and metadata, and leaves the trace linkage immutable; use create_feedback only for a new record.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The unique identifier of the feedback to update | |
| value | No | New feedback value/rating. Common patterns: 1 for positive, 0 for negative. | |
| weight | No | New weighting factor for the feedback | |
| metadata | No | New or updated custom metadata for the feedback |
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/tracing.service.ts:37-45 (handler)The actual method that sends the PUT request to update feedback. Calls this.put() with the feedback ID encoded in the URL path and the update data (value, weight, metadata).
async updateFeedback( id: string, data: UpdateFeedbackRequest, ): Promise<UpdateFeedbackResponse> { return this.put<UpdateFeedbackResponse>( `/feedback/${this.encodePathSegment(id)}`, data, ); } - UpdateFeedbackRequest interface - defines the input schema for updating feedback (value, weight, metadata all optional).
export interface UpdateFeedbackRequest { value?: number; weight?: number; metadata?: Record<string, unknown>; } export interface UpdateFeedbackResponse { status: "success" | "failure"; message: string; feedback_ids: string[]; } - UpdateFeedbackResponse interface - defines the response shape (status, message, feedback_ids).
export interface UpdateFeedbackResponse { status: "success" | "failure"; message: string; feedback_ids: string[]; } - src/tools/tracing.tools.ts:86-114 (registration)Registers the 'update_feedback' tool on the MCP server with its Zod schema and handler function. The handler calls service.tracing.updateFeedback(params.id, ...) and formats the response.
// Update feedback server.tool( "update_feedback", "Update an existing feedback record by ID. Returns the updated status and feedback IDs, changes only value, weight, and metadata, and leaves the trace linkage immutable; use create_feedback only for a new record.", TRACING_TOOL_SCHEMAS.updateFeedback, async (params) => { const result = await service.tracing.updateFeedback(params.id, { value: params.value, weight: params.weight, metadata: params.metadata, }); return { content: [ { type: "text", text: JSON.stringify( { message: `Successfully updated feedback "${params.id}"`, status: result.status, feedback_ids: result.feedback_ids, }, null, 2, ), }, ], }; }, ); - src/tools/tracing.tools.ts:31-48 (schema)Zod schema for update_feedback tool parameters: id (required string), value (optional number), weight (optional positive number), metadata (optional record).
updateFeedback: { id: z.string().describe("The unique identifier of the feedback to update"), value: z.coerce .number() .optional() .describe( "New feedback value/rating. Common patterns: 1 for positive, 0 for negative.", ), weight: z.coerce .number() .positive() .optional() .describe("New weighting factor for the feedback"), metadata: z .record(z.string(), z.unknown()) .optional() .describe("New or updated custom metadata for the feedback"), },