Skip to main content
Glama

list-tv-reviews

Retrieve reviews for TV shows from Douban using the show's unique ID to analyze audience feedback and critical reception.

Instructions

list tv reviews

Input Schema

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

Implementation Reference

  • The handler function that implements the core logic of the 'list-tv-reviews' tool: validates input, fetches reviews using getTVReviews, formats them into a markdown table using json2md, and returns as text content.
    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 }] } }
  • src/index.ts:152-180 (registration)
    The registration of the 'list-tv-reviews' tool on the MCP server, including name, description, input schema, and inline 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 }] } } )
  • Zod input schema for the tool, defining a required 'id' parameter as string with description.
    { id: z.string().describe('douban tv id, e.g. "1234567890"') },
  • Supporting function that fetches the list of TV reviews from the Douban Frodo API endpoint.
    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