get_labels
Retrieve all configured labels from Tiny Tiny RSS. Optionally check if a specific article has particular labels by providing its article ID.
Instructions
获取所有已配置的标签列表。可传入 article_id 查看该文章是否有某标签。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| article_id | No | 指定文章 ID 时,返回结果中 checked 表示该文章是否有此标签 |
Implementation Reference
- src/tools/labels.ts:6-28 (handler)The 'get_labels' tool handler registration and implementation in 'src/tools/labels.ts'.
server.tool( "get_labels", "获取所有已配置的标签列表。可传入 article_id 查看该文章是否有某标签。", { article_id: z .number() .optional() .describe("指定文章 ID 时,返回结果中 checked 表示该文章是否有此标签"), }, async ({ article_id }) => { try { const labels = await client.getLabels(article_id); return { content: [{ type: "text" as const, text: JSON.stringify(labels, null, 2) }], }; } catch (e: unknown) { return { content: [{ type: "text" as const, text: `获取标签失败: ${(e as Error).message}` }], isError: true, }; } }, ); - src/tools/labels.ts:5-5 (registration)Registration function for the 'get_labels' tool.
export function registerLabelTools(server: McpServer, client: TtrssClient) {