list_entries
Retrieve paginated recent entries from all feeds. Sort by published or created date in ascending or descending order.
Instructions
[read] List recent entries across all feeds, paginated. Use sort_by='published' (default) for newest first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | ||
| per_page | No | ||
| sort_by | No | published | |
| sort_order | No | desc |
Implementation Reference
- src/tools.ts:182-190 (handler)Handler function that builds query params (page, per_page, sort_by, sort_order) and makes a GET request to /api/v1/entries
handler: (input: any, c) => { const qs = new URLSearchParams({ page: String(input.page), per_page: String(input.per_page), sort_by: input.sort_by, sort_order: input.sort_order, }).toString(); return c.request("GET", `/api/v1/entries?${qs}`); }, - src/tools.ts:176-181 (schema)Zod schema for input validation: page (default 1), per_page (default 20, max 100), sort_by (enum 'published'|'created', default 'published'), sort_order (enum 'asc'|'desc', default 'desc')
inputSchema: z.object({ page: z.number().int().positive().default(1), per_page: z.number().int().min(1).max(100).default(20), sort_by: z.enum(["published", "created"]).default("published"), sort_order: z.enum(["asc", "desc"]).default("desc"), }), - src/tools.ts:172-191 (registration)Tool definition within the TOOLS array, registered with name 'list_entries', scope 'read', and description
name: "list_entries", description: "List recent entries across all feeds, paginated. Use sort_by='published' (default) for newest first.", scope: "read", inputSchema: z.object({ page: z.number().int().positive().default(1), per_page: z.number().int().min(1).max(100).default(20), sort_by: z.enum(["published", "created"]).default("published"), sort_order: z.enum(["asc", "desc"]).default("desc"), }), handler: (input: any, c) => { const qs = new URLSearchParams({ page: String(input.page), per_page: String(input.per_page), sort_by: input.sort_by, sort_order: input.sort_order, }).toString(); return c.request("GET", `/api/v1/entries?${qs}`); }, }, - src/index.ts:37-43 (registration)Registration of all tools (including list_entries) with the MCP server via ListToolsRequestSchema handler
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS.map((t) => ({ name: t.name, description: `[${t.scope}] ${t.description}`, inputSchema: zodToJsonSchema(t.inputSchema, { target: "openApi3" }), })), })); - src/index.ts:45-86 (registration)CallToolRequestSchema handler that looks up the tool by name (including list_entries), validates args, and calls the handler
server.setRequestHandler(CallToolRequestSchema, async (req) => { const tool = TOOLS.find((t) => t.name === req.params.name); if (!tool) { return { isError: true, content: [{ type: "text", text: `Unknown tool: ${req.params.name}` }], }; } const parsed = tool.inputSchema.safeParse(req.params.arguments ?? {}); if (!parsed.success) { return { isError: true, content: [ { type: "text", text: `Invalid arguments: ${parsed.error.message}`, }, ], }; } try { const result = await tool.handler(parsed.data, client); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; } catch (err) { const e = err as Error & { status?: number; body?: unknown }; return { isError: true, content: [ { type: "text", text: JSON.stringify( { error: e.message, status: e.status, body: e.body }, null, 2, ), }, ], }; } });