Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe unique identifier of the feedback to update
valueNoNew feedback value/rating. Common patterns: 1 for positive, 0 for negative.
weightNoNew weighting factor for the feedback
metadataNoNew or updated custom metadata for the feedback

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 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[];
    }
  • 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,
    					),
    				},
    			],
    		};
    	},
    );
  • 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"),
    },
Behavior4/5

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

Annotations indicate non-readonly, non-destructive, non-idempotent, open-world. The description adds that only value, weight, and metadata are changed, trace linkage is immutable, and it returns updated status and IDs. This provides useful context beyond annotations, though it could mention potential side effects (e.g., impact on analytics).

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?

The description is two sentences, front-loaded with the action and return, then constraints and alternative. Every sentence adds value without redundancy.

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?

Given the tool's complexity (4 parameters, output schema exists) and the presence of sibling alternatives, the description covers the essential aspects: purpose, modifiable fields, immutability of trace linkage, and usage guidance. No critical information is missing.

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

Parameters3/5

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

The input schema has 100% description coverage for all four parameters. The description summarizes which parameters are modifiable but does not add new semantic details beyond the schema. The mention of return values is about output, not input parameters.

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 an existing feedback record by ID' with a specific verb and resource. It details what fields are changed (value, weight, metadata) and distinguishes from the sibling tool create_feedback, which is for new records.

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?

The description explicitly states when to use this tool (to update existing feedback) and when not (use create_feedback for a new record). It also clarifies that trace linkage is immutable, guiding parameter selection.

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