Skip to main content
Glama

subscribe_feed

Add new RSS feeds to your Tiny Tiny RSS instance by providing the feed URL, optional category, and authentication credentials when required.

Instructions

订阅新的 RSS 源

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
feed_urlYesRSS 源的 URL
category_idNo放入的分类 ID,默认 0 (未分类)
loginNo源需要认证时的用户名
passwordNo源需要认证时的密码

Implementation Reference

  • The MCP tool registration and handler logic for "subscribe_feed" which calls the underlying client method.
    server.tool(
      "subscribe_feed",
      "订阅新的 RSS 源",
      {
        feed_url: z.string().url().describe("RSS 源的 URL"),
        category_id: z
          .number()
          .default(0)
          .describe("放入的分类 ID,默认 0 (未分类)"),
        login: z.string().optional().describe("源需要认证时的用户名"),
        password: z.string().optional().describe("源需要认证时的密码"),
      },
      async (params) => {
        try {
          const result = await client.subscribeToFeed(params);
          const code = result.status.code;
          const messages: Record<number, string> = {
            0: "订阅成功",
            1: "已订阅该源",
            2: "无效的 URL",
            3: "URL 中未找到 RSS 源",
            4: "URL 中发现多个 RSS 源 (请指定具体的源地址)",
            5: "无法下载该 URL",
            6: "内容重复",
          };
          const msg = messages[code] ?? `未知状态码: ${code}`;
          if (code !== 0 && code !== 1) {
            return {
              content: [{ type: "text" as const, text: msg }],
              isError: true,
            };
          }
          return { content: [{ type: "text" as const, text: msg }] };
        } catch (e: unknown) {
          return {
            content: [{ type: "text" as const, text: `订阅失败: ${(e as Error).message}` }],
            isError: true,
          };
        }
      },
    );
  • The underlying client method that performs the API request to subscribe to a feed.
    async subscribeToFeed(params: {
      feed_url: string;
      category_id?: number;
      login?: string;
      password?: string;
    }): Promise<{ status: { code: number } }> {
      return this.request("subscribeToFeed", 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