Skip to main content
Glama
moria97
by moria97

list-group-topics

Retrieve discussion topics from Douban groups by specifying group ID, filtering with tags, and setting date ranges to find relevant conversations.

Instructions

list group topics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNodouban group id
tagsNotags, e.g. ["python"]
from_dateNofrom date, e.g. "2024-01-01"

Implementation Reference

  • The handler function for the 'list-group-topics' tool. It defaults the group ID to '732764', fetches topics via getGroupTopics, formats the results as a markdown table using json2md, and returns them as text content.
    async (args) => {
      const id = args.id || '732764'
      const topics = await getGroupTopics({ id, tags: args.tags, from_date: args.from_date })
    
      const text = json2md({
        table: {
          headers: ['publish_date', 'tags', 'title', 'id'],
          rows: topics.map(_ => ({
            id: _.id,
            tags: _.topic_tags.map(_ => _.name).join('、'),
            title: `[${_.title}](${_.url})`,
            publish_date: dayjs(_.create_time).format('YYYY/MM/DD'),
          }))
        }
      })
    
      return {
        content: [{ type: "text", text }]
      }
    }
  • Helper function that performs the API request to fetch group topics from Douban's Frodo API, filters out ad topics, and applies optional filters for tags and date range.
    export async function getGroupTopics(params: {
      id: string
      tags?: string[]
      from_date?: string
    }) {
      const res = await requestFrodoApi(`/group/${params.id}/topics`)
    
      let topics = (res.topics as Douban.Topic[] || []).filter(_ => !_.is_ad)
    
      if (params.tags) {
        topics = topics.filter(_ => _.topic_tags.some(tag => params.tags?.includes(tag.name)))
      }
    
      if (params.from_date) {
        topics = topics.filter(_ => dayjs(_.create_time).isAfter(dayjs(params.from_date)))
      }
    
    
      return topics
    }
  • Zod input schema defining optional parameters for the tool: group ID, tags array, and start date.
    {
      id: z.string().optional().describe('douban group id'),
      tags: z.array(z.string()).optional().describe('tags, e.g. ["python"]'),
      from_date: z.string().optional().describe('from date, e.g. "2024-01-01"')
    },
  • src/index.ts:206-234 (registration)
    MCP server registration of the 'list-group-topics' tool, including description, input schema, and inline handler function.
    server.tool(
      TOOL.LIST_GROUP_TOPICS,
      "list group topics",
      {
        id: z.string().optional().describe('douban group id'),
        tags: z.array(z.string()).optional().describe('tags, e.g. ["python"]'),
        from_date: z.string().optional().describe('from date, e.g. "2024-01-01"')
      },
      async (args) => {
        const id = args.id || '732764'
        const topics = await getGroupTopics({ id, tags: args.tags, from_date: args.from_date })
    
        const text = json2md({
          table: {
            headers: ['publish_date', 'tags', 'title', 'id'],
            rows: topics.map(_ => ({
              id: _.id,
              tags: _.topic_tags.map(_ => _.name).join('、'),
              title: `[${_.title}](${_.url})`,
              publish_date: dayjs(_.create_time).format('YYYY/MM/DD'),
            }))
          }
        })
    
        return {
          content: [{ type: "text", text }]
        }
      }
    );
  • TypeScript interface defining the Topic object used in the tool's response data.
    interface Topic {
      update_time: string
      is_event: boolean
      is_elite: boolean
      title: string
      url: string
      topic_tags: { id: string; name: string }[]
      author: any[]
      uri: string
      cover_url: string
      id: string
      create_time: string
      comments_count: number
      activity_tag: null
      gallery_topic: null
      label: string
      type: string
      is_ad: boolean
    }
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. However, it offers no information about what the tool returns (e.g., list format, pagination), error conditions, rate limits, or authentication requirements. For a tool with three parameters and no output schema, this lack of behavioral context is a significant gap.

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

Conciseness5/5

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

The description is extremely concise with just three words, front-loading the essential action and resource. There is zero wasted language or redundancy, making it efficient for quick scanning. However, this conciseness comes at the cost of completeness, as noted in other dimensions.

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 tool's complexity (three parameters, no output schema, no annotations), the description is incomplete. It fails to explain what 'topics' are, how results are returned, or any behavioral traits. While the schema covers parameters, the overall context for using the tool effectively is lacking, making it inadequate for a tool of this nature.

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 schema description coverage is 100%, meaning all parameters are documented in the schema itself. The description adds no additional meaning about the parameters beyond what's already in the schema (e.g., 'id' as 'douban group id', 'tags' as an array of strings). Since the schema does the heavy lifting, the baseline score of 3 is appropriate, though the description doesn't compensate or enhance understanding.

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

Purpose2/5

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

The description 'list group topics' is essentially a tautology that restates the tool name with minimal elaboration. It specifies the verb 'list' and resource 'group topics' but lacks any distinguishing details about scope, format, or how it differs from sibling tools like 'get-group-topic-detail'. While it conveys the basic action, it's too vague to be genuinely helpful.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. There is no mention of prerequisites, context, or comparisons to sibling tools such as 'browse' or 'get-group-topic-detail'. Without any usage instructions, the agent must infer everything from the tool name and parameters alone.

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

Install Server

Other Tools

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