Skip to main content
Glama

get_categories

Retrieve tt-rss categories with unread counts. Filter to show only categories containing unread articles or include empty categories as needed.

Instructions

获取 tt-rss 的分类列表,包含各分类的未读数。可选只返回有未读文章的分类。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
unread_onlyNo仅返回有未读文章的分类
enable_nestedNo嵌套模式,只返回顶级分类
include_emptyNo包含空分类

Implementation Reference

  • Registration of the 'get_categories' tool using server.tool.
    server.tool(
      "get_categories",
      "获取 tt-rss 的分类列表,包含各分类的未读数。可选只返回有未读文章的分类。",
      {
        unread_only: z
          .boolean()
          .default(false)
          .describe("仅返回有未读文章的分类"),
        enable_nested: z
          .boolean()
          .default(false)
          .describe("嵌套模式,只返回顶级分类"),
        include_empty: z
          .boolean()
          .default(true)
          .describe("包含空分类"),
      },
      async (params) => {
        try {
          const categories = await client.getCategories(params);
          return {
            content: [{ type: "text" as const, text: JSON.stringify(categories, null, 2) }],
          };
        } catch (e: unknown) {
          return {
            content: [{ type: "text" as const, text: `获取分类失败: ${(e as Error).message}` }],
            isError: true,
          };
        }
      },
    );
  • The actual implementation that calls the backend API for 'get_categories'.
    async getCategories(params: {
      unread_only?: boolean;
      enable_nested?: boolean;
      include_empty?: boolean;
    } = {}): Promise<TtrssCategory[]> {
      return this.request<TtrssCategory[]>("getCategories", params);
    }

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/aooiuu/ttrss-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server