get_headlines
Retrieve article headlines from Tiny Tiny RSS feeds with filtering options for unread, starred, or specific categories to organize your reading workflow.
Instructions
获取文章标题列表。特殊 feed_id: -4=全部, -3=最新, -2=已发布, -1=星标, 0=已归档。可按 view_mode 过滤未读/星标等。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| feed_id | No | 源 ID。-4=全部, -3=最新, -2=已发布, -1=星标, 0=已归档, 正数=具体源 | |
| limit | No | 返回数量限制 (最大 200) | |
| skip | No | 跳过前 N 篇 | |
| view_mode | No | 过滤模式 | unread |
| is_cat | No | feed_id 是否为分类 ID | |
| show_excerpt | No | 返回文章摘要 | |
| show_content | No | 返回文章全文 (较大) | |
| include_attachments | No | 包含附件信息 | |
| order_by | No | 排序方式: 空=默认, feed_dates=最新优先, date_reverse=最旧优先 | |
| since_id | No | 只返回 ID 大于此值的文章 |
Implementation Reference
- src/tools/articles.ts:14-60 (registration)Registration and implementation handler for the "get_headlines" tool. It calls the client's getHeadlines method and returns a simplified version of the results.
server.tool( "get_headlines", "获取文章标题列表。特殊 feed_id: -4=全部, -3=最新, -2=已发布, -1=星标, 0=已归档。可按 view_mode 过滤未读/星标等。", { feed_id: z .number() .default(-4) .describe("源 ID。-4=全部, -3=最新, -2=已发布, -1=星标, 0=已归档, 正数=具体源"), limit: z.number().default(20).describe("返回数量限制 (最大 200)"), skip: z.number().default(0).describe("跳过前 N 篇"), view_mode: z .enum(["all_articles", "unread", "adaptive", "marked", "updated"]) .default("unread") .describe("过滤模式"), is_cat: z.boolean().default(false).describe("feed_id 是否为分类 ID"), show_excerpt: z.boolean().default(true).describe("返回文章摘要"), show_content: z.boolean().default(false).describe("返回文章全文 (较大)"), include_attachments: z.boolean().default(false).describe("包含附件信息"), order_by: z .enum(["", "feed_dates", "date_reverse"]) .default("") .describe("排序方式: 空=默认, feed_dates=最新优先, date_reverse=最旧优先"), since_id: z.number().optional().describe("只返回 ID 大于此值的文章"), }, async (params) => { try { const headlines = await client.getHeadlines(params); const simplified = headlines.map((h) => ({ id: h.id, title: h.title, feed_title: h.feed_title, link: h.link, unread: h.unread, marked: h.marked, updated: new Date(h.updated * 1000).toISOString(), author: h.author, excerpt: h.excerpt, ...(params.show_content ? { content: h.content } : {}), labels: h.labels, note: h.note, })); return ok(JSON.stringify(simplified, null, 2)); } catch (e: unknown) { return fail(`获取文章列表失败: ${(e as Error).message}`); } }, );