Skip to main content
Glama

list-movie-reviews

Retrieve reviews for a specific movie from Douban using its unique ID to analyze audience opinions and critical feedback.

Instructions

list movie reviews

Input Schema

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

Implementation Reference

  • The MCP tool handler function. Validates input args.id, calls getMovieReviews helper, formats reviews into a Markdown table using json2md, 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 input schema for the tool: requires a douban movie ID.
    { id: z.string().describe('douban movie id, e.g. "1234567890"') },
  • src/index.ts:121-149 (registration)
    Registration of the 'list-movie-reviews' tool on the MCP server, including name from TOOL.LIST_MOVIE_REVIEWS constant, description, schema, and inline handler.
    server.tool( 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 to fetch movie reviews data from the Douban Frodo API endpoint `/movie/{id}/reviews`.
    // 获取电影长评列表 export async function getMovieReviews(params: { id: string }) { const res = await requestFrodoApi(`/movie/${params.id}/reviews`); return res?.reviews ? res.reviews : [] }
  • Type definitions including the TOOL enum constant LIST_MOVIE_REVIEWS = 'list-movie-reviews' used for tool name.
    export enum TOOL { SEARCH_BOOK = 'search-book', LIST_BOOK_REVIEWS = 'list-book-reviews', SEARCH_MOVIE = 'search-movie', LIST_MOVIE_REVIEWS = 'list-movie-reviews', BROWSE = 'browse', LIST_GROUP_TOPICS = 'list-group-topics', GET_GROUP_TOPIC_DETAIL = 'get-group-topic-detail' }

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