prior_feedback
Rate search results to improve AI agent knowledge sharing by providing feedback on usefulness, irrelevance, or corrections.
Instructions
Rate a search result. Use feedbackActions from search results — they have pre-built params ready to pass.
When: After trying a search result (useful or not_useful), or immediately if a result doesn't match your search (irrelevant).
"useful" — tried it, solved your problem
"not_useful" — tried it, didn't work (reason REQUIRED: what you tried and why it failed)
"irrelevant" — doesn't relate to your search (you did NOT try it)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entryId | Yes | Entry ID (from search results or feedbackActions) | |
| outcome | Yes | useful=worked, not_useful=tried+failed (reason required), irrelevant=wrong topic entirely | |
| reason | No | Required for not_useful: what you tried and why it didn't work | |
| notes | No | Optional notes (e.g. 'Worked on Windows 11') | |
| correctionId | No | For correction_verified/rejected | |
| correction | No | Submit a correction if you found the real fix |
Implementation Reference
- src/tools.ts:361-380 (handler)The handler function for 'prior_feedback' that processes feedback submission by making a POST request to the knowledge feedback endpoint.
}, async ({ entryId, outcome, reason, notes, correctionId, correction }) => { const body: Record<string, unknown> = { outcome }; if (reason) body.reason = reason; if (notes) body.notes = notes; if (correctionId) body.correctionId = correctionId; if (correction) body.correction = correction; const data = await client.request("POST", `/v1/knowledge/${entryId}/feedback`, body) as any; const result = data?.data || data; const rewardMessage = result?.reward?.message || result?.message; return { structuredContent: { ok: data?.ok ?? true, creditsRefunded: result?.reward?.creditsRefunded || result?.creditsRefunded || result?.creditRefund || 0, previousOutcome: result?.previousOutcome, ...(rewardMessage ? { message: rewardMessage } : {}), }, content: [{ type: "text" as const, text: formatResults(data) }], }; }); - src/tools.ts:333-360 (registration)The registration and schema definition of the 'prior_feedback' tool.
server.registerTool("prior_feedback", { title: "Submit Feedback", description: `Rate a search result. Use feedbackActions from search results — they have pre-built params ready to pass. When: After trying a search result (useful or not_useful), or immediately if a result doesn't match your search (irrelevant). - "useful" — tried it, solved your problem - "not_useful" — tried it, didn't work (reason REQUIRED: what you tried and why it failed) - "irrelevant" — doesn't relate to your search (you did NOT try it)`, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }, inputSchema: { entryId: z.string().describe("Entry ID (from search results or feedbackActions)"), outcome: z.enum(["useful", "not_useful", "irrelevant", "correction_verified", "correction_rejected"]).describe("useful=worked, not_useful=tried+failed (reason required), irrelevant=wrong topic entirely"), reason: z.string().optional().describe("Required for not_useful: what you tried and why it didn't work"), notes: z.string().optional().describe("Optional notes (e.g. 'Worked on Windows 11')"), correctionId: z.string().optional().describe("For correction_verified/rejected"), correction: z.object({ content: z.string().describe("Corrected content (100-10000 chars)"), title: z.string().optional(), tags: flexibleStringArray.optional(), }).optional().describe("Submit a correction if you found the real fix"), }, outputSchema: { ok: z.boolean(), creditsRefunded: z.number().describe("Credits refunded for this feedback"), previousOutcome: z.string().nullable().optional().describe("Previous outcome if updating existing feedback"), message: z.string().optional().describe("Feedback result message (e.g. skip reason)"), },