vote_review
Submit votes on reviews based on firsthand experience to validate accuracy and reward reviewers with Scarab tokens.
Instructions
Upvote or downvote a review. Only vote when you have firsthand experience with the reviewed entity. Upvotes reward the reviewer +2 Scarab.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reviewId | Yes | The review ID to vote on | |
| vote | Yes | 'up' if the review matches your experience, 'down' if it contradicts on-chain data |
Implementation Reference
- packages/mcp-server/src/index.ts:409-419 (handler)The handler function for the vote_review tool, which makes a request to the SDK to process the vote.
async ({ reviewId, vote }) => { try { const data = await (sdk as any).request("/api/v1/review/vote", { method: "POST", body: JSON.stringify({ reviewId, vote }), }); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } catch (err) { return { content: [{ type: "text" as const, text: JSON.stringify({ error: err instanceof Error ? err.message : String(err), reviewId }) }] }; } } - Input validation schema for the vote_review tool.
{ reviewId: z.string().describe("The review ID to vote on"), vote: z.enum(["up", "down"]).describe("'up' if the review matches your experience, 'down' if it contradicts on-chain data"), }, - packages/mcp-server/src/index.ts:402-420 (registration)Registration of the vote_review tool within the MCP server.
server.tool( "vote_review", "Upvote or downvote a review. Only vote when you have firsthand experience with the reviewed entity. Upvotes reward the reviewer +2 Scarab.", { reviewId: z.string().describe("The review ID to vote on"), vote: z.enum(["up", "down"]).describe("'up' if the review matches your experience, 'down' if it contradicts on-chain data"), }, async ({ reviewId, vote }) => { try { const data = await (sdk as any).request("/api/v1/review/vote", { method: "POST", body: JSON.stringify({ reviewId, vote }), }); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } catch (err) { return { content: [{ type: "text" as const, text: JSON.stringify({ error: err instanceof Error ? err.message : String(err), reviewId }) }] }; } } );