Skip to main content
Glama

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
NameRequiredDescriptionDefault
reviewIdYesThe review ID to vote on
voteYes'up' if the review matches your experience, 'down' if it contradicts on-chain data

Implementation Reference

  • 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"),
    },
  • 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 }) }] };
        }
      }
    );

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/JhiNResH/maiat-protocol'

If you have feedback or need assistance with the MCP directory API, please join our Discord server