Skip to main content
Glama
moria97
by moria97

get-group-topic-detail

Retrieve detailed information about a specific Douban group discussion topic using its unique identifier to access content and participant data.

Instructions

get group topic detail

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesdouban group topic id, e.g. "1234567890"

Implementation Reference

  • The core handler function that fetches the group topic detail data from the Douban Frodo API using the shared requestFrodoApi utility.
    // 获取小组话题详情
    export async function getGroupTopicDetail(params: {
      id: string
    }) {
      const res: Douban.TopicDetail = await requestFrodoApi(`/group/topic/${params.id}`)
    
      return res
    }
  • TypeScript interface defining the structure of the group topic detail response from the API.
    interface TopicDetail extends Topic {
      like_count: number
      comments_count: number
      collections_count: number
      reshares_count: number
      content: string
      abstract: string
    }
  • src/index.ts:237-261 (registration)
    Registers the MCP tool 'get-group-topic-detail' with description, Zod input schema (id: string), and handler that fetches data, formats it to markdown, and returns as text content.
    server.tool(
      TOOL.GET_GROUP_TOPIC_DETAIL,
      "get group topic detail",
      {
        id: z.string().describe('douban group topic id, e.g. "1234567890"')
      },
      async (args) => {
        if (!args.id) {
          throw new McpError(ErrorCode.InvalidParams, "douban group topic id must be provided")
        }
    
        const topic = await getGroupTopicDetail({ id: args.id })
        if (!topic?.id) throw new McpError(ErrorCode.InvalidRequest, "request failed")
    
        const tService = new TurndownService()
        const text = `title: ${topic.title}
    tags: ${topic.topic_tags.map(_ => _.name).join('|')}
    content:
    ${tService.turndown(topic.content)}
    `
        return {
          content: [{ type: "text", text }]
        }
      }
    );
  • Utility function to make authenticated requests to the Douban Frodo API, used by getGroupTopicDetail.
    const requestFrodoApi = async (url: string) => {
      const fullURL = 'https://frodo.douban.com/api/v2' + url;
      const date = dayjs().format('YYYYMMDD')
    
      const rParams = {
        os_rom: 'android',
        apiKey: '0dad551ec0f84ed02907ff5c42e8ec70',
        _ts: date,
        _sig: getFrodoSign(fullURL, date),
      };
    
      const oUrl = new URL(fullURL)
    
      for (let key in rParams) {
        // @ts-ignore
        oUrl.searchParams.set(key, rParams[key])
      }
    
    
      const req = await fetch(oUrl.toString(), {
        headers: {
          'user-agent': getUA(),
          cookie: process.env.COOKIE || ''
        }
      })
    
      return req.json()
    }
  • Enum constant defining the tool name string used in registration.
    GET_GROUP_TOPIC_DETAIL = 'get-group-topic-detail'

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.0.0
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

D1.7/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must carry the full burden of behavioral disclosure. However, it only states 'get group topic detail' without revealing any behavioral traits such as side effects, error handling, authorization needs, rate limits, or return format. This is a complete absence of behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely short, but this is under-specification rather than genuine conciseness. It merely repeats the tool name and provides no valuable information, so it does not earn its place in the description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations, no output schema, and the existence of sibling tools that could be confused with this one, the description is incomplete. It fails to explain what a group topic detail includes, how it relates to list-group-topics, or any edge cases, leaving significant gaps in a simple tool context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema fully documents the single 'id' parameter with a description and example, giving 100% coverage. The tool description adds no additional meaning to the parameter, so it meets the baseline of 3 as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'get group topic detail' is simply the tool name with spaces, restating the name without adding any semantic content. It is tautological, similar to the 'Process' example, and does not provide a clear, informative purpose beyond what the name already implies.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like list-group-topics or get-movie-detail. The description gives no context about use cases, prerequisites, or situations to avoid, leaving the agent without decision-making support.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.