Skip to main content
Glama

list-tv-reviews

Retrieve TV show reviews from Douban by providing the show's ID to analyze audience feedback and ratings.

Instructions

list tv reviews

Input Schema

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

Implementation Reference

  • The handler function for the "list-tv-reviews" tool. It validates the input 'id', fetches TV reviews via getTVReviews, formats them into a markdown table using json2md, and returns the content as text.
    async (args) => { if (!args.id) { throw new McpError(ErrorCode.InvalidParams, "douban tv id must be provided") } const reviews = await getTVReviews({ 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 defining the required 'id' parameter (Douban TV ID).
    { id: z.string().describe('douban tv id, e.g. "1234567890"') },
  • src/index.ts:152-180 (registration)
    MCP server.tool registration for 'list-tv-reviews', including name, description, schema, and handler function.
    server.tool( 'list-tv-reviews', "list tv reviews", { id: z.string().describe('douban tv id, e.g. "1234567890"') }, async (args) => { if (!args.id) { throw new McpError(ErrorCode.InvalidParams, "douban tv id must be provided") } const reviews = await getTVReviews({ 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 getTVReviews that queries the Douban Frodo API for TV reviews given the TV ID and returns the reviews array.
    // 获取电视剧长评列表 export async function getTVReviews(params: { id: string }) { const res = await requestFrodoApi(`/tv/${params.id}/reviews`); return res?.reviews ? res.reviews : [] }

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