update_article
Modify article statuses in Tiny Tiny RSS by setting, clearing, or toggling starred, published, unread, or note states for specified articles.
Instructions
更新文章状态。field: 0=星标, 1=已发布, 2=未读, 3=笔记。mode: 0=取消, 1=设置, 2=切换。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| article_ids | Yes | 文章 ID 列表,逗号分隔 (如 '123,456') | |
| field | Yes | 操作字段: 0=星标, 1=已发布, 2=未读, 3=笔记 | |
| mode | Yes | 操作模式: 0=取消, 1=设置, 2=切换 | |
| data | No | 当 field=3 (笔记) 时,笔记内容 |
Implementation Reference
- src/tools/articles.ts:108-125 (handler)Registration and tool handler for update_article in src/tools/articles.ts.
server.tool( "update_article", "更新文章状态。field: 0=星标, 1=已发布, 2=未读, 3=笔记。mode: 0=取消, 1=设置, 2=切换。", { article_ids: z.string().describe("文章 ID 列表,逗号分隔 (如 '123,456')"), field: z.number().min(0).max(3).describe("操作字段: 0=星标, 1=已发布, 2=未读, 3=笔记"), mode: z.number().min(0).max(2).describe("操作模式: 0=取消, 1=设置, 2=切换"), data: z.string().optional().describe("当 field=3 (笔记) 时,笔记内容"), }, async (params) => { try { const result = await client.updateArticle(params); return ok(`操作成功,更新了 ${result.updated} 篇文章`); } catch (e: unknown) { return fail(`更新文章失败: ${(e as Error).message}`); } }, ); - src/ttrss-client.ts:114-121 (helper)API client method for performing the update_article request.
async updateArticle(params: { article_ids: string; mode: number; field: number; data?: string; }): Promise<{ status: string; updated: number }> { return this.request("updateArticle", params); }