Skip to main content
Glama

set_article_label

Add or remove labels from articles in Tiny Tiny RSS to organize and categorize your feed content effectively.

Instructions

为文章设置或移除标签

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
article_idsYes文章 ID 列表,逗号分隔 (如 '123,456')
label_idYes标签 ID (从 get_labels 获取)
assignYestrue=添加标签, false=移除标签

Implementation Reference

  • Tool handler for `set_article_label` that calls `client.setArticleLabel` and processes the result.
    async (params) => {
      try {
        const result = await client.setArticleLabel(params);
        const action = params.assign ? "添加" : "移除";
        return {
          content: [{ type: "text" as const, text: `${action}标签成功,更新了 ${result.updated} 篇文章` }],
        };
      } catch (e: unknown) {
        return {
          content: [{ type: "text" as const, text: `设置标签失败: ${(e as Error).message}` }],
          isError: true,
        };
      }
    },
  • Registration of the `set_article_label` tool via the MCP server instance.
    server.tool(
      "set_article_label",
      "为文章设置或移除标签",
      {
        article_ids: z.string().describe("文章 ID 列表,逗号分隔 (如 '123,456')"),
        label_id: z.number().describe("标签 ID (从 get_labels 获取)"),
        assign: z.boolean().describe("true=添加标签, false=移除标签"),
      },
      async (params) => {
        try {
          const result = await client.setArticleLabel(params);
          const action = params.assign ? "添加" : "移除";
          return {
            content: [{ type: "text" as const, text: `${action}标签成功,更新了 ${result.updated} 篇文章` }],
          };
        } catch (e: unknown) {
          return {
            content: [{ type: "text" as const, text: `设置标签失败: ${(e as Error).message}` }],
            isError: true,
          };
        }
      },
    );
  • Zod schema definition for `set_article_label` arguments (article_ids, label_id, assign).
    {
      article_ids: z.string().describe("文章 ID 列表,逗号分隔 (如 '123,456')"),
      label_id: z.number().describe("标签 ID (从 get_labels 获取)"),
      assign: z.boolean().describe("true=添加标签, false=移除标签"),
    },
  • The client-side method `setArticleLabel` which sends the `setArticleLabel` request to the tt-rss API.
    async setArticleLabel(params: {
      article_ids: string;
      label_id: number;
      assign: boolean;
    }): Promise<{ status: string; updated: number }> {
      return this.request("setArticleLabel", 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