Skip to main content
Glama

list-movie-reviews

Retrieve movie reviews from Douban by providing the movie ID to analyze audience feedback and critical perspectives.

Instructions

list movie reviews

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesdouban movie id, e.g. "1234567890"

Implementation Reference

  • MCP tool handler for 'list-movie-reviews': validates input ID, fetches movie reviews via getMovieReviews, formats results as a markdown table, and returns structured text content.
    async (args) => { if (!args.id) { throw new McpError(ErrorCode.InvalidParams, "douban movie id must be provided") } const reviews = await getMovieReviews({ id: args.id }) const text = json2md({ table: { headers: ['title', 'rating', 'summary', 'id'], rows: reviews.map(_ => ({ id: _.id, title: _.title, rating: `${_.rating?.value || 0} (有用:${_.useful_count || 0}人)`, summary: _.abstract })) } }) return { content: [{ type: "text", text }] } }
  • Zod schema for input parameters of the 'list-movie-reviews' tool, requiring a douban movie ID.
    { id: z.string().describe('douban movie id, e.g. "1234567890"') },
  • src/index.ts:122-149 (registration)
    Registration of the 'list-movie-reviews' tool in the MCP server using server.tool, specifying name from TOOL enum, description, input schema, and handler function.
    TOOL.LIST_MOVIE_REVIEWS, "list movie reviews", { id: z.string().describe('douban movie id, e.g. "1234567890"') }, async (args) => { if (!args.id) { throw new McpError(ErrorCode.InvalidParams, "douban movie id must be provided") } const reviews = await getMovieReviews({ id: args.id }) const text = json2md({ table: { headers: ['title', 'rating', 'summary', 'id'], rows: reviews.map(_ => ({ id: _.id, title: _.title, rating: `${_.rating?.value || 0} (有用:${_.useful_count || 0}人)`, summary: _.abstract })) } }) return { content: [{ type: "text", text }] } } )
  • Helper function that performs the actual API request to fetch movie reviews from Douban's Frodo API endpoint.
    export async function getMovieReviews(params: { id: string }) { const res = await requestFrodoApi(`/movie/${params.id}/reviews`); return res?.reviews ? res.reviews : [] }
  • TypeScript interface defining the expected structure of individual movie reviews returned by the API.
    interface MovieReview { id: string title: string alt: string subject_id: string author: { id: string name: string uid: string signature: string alt: string avatar: string }[] rating: { max: number numRaters: number average: string min: number } summary: string }

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/moria97/douban-mcp'

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