search_feeds
Search a feed catalog by keyword to find feeds matching titles, URLs, or hostnames, returning up to 20 results with recency statistics.
Instructions
[read] Search the feed catalog by keyword. Matches feed titles, urls, and hostnames. Returns up to 20 results with recency stats.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Implementation Reference
- src/tools.ts:137-141 (handler)The handler function for the search_feeds tool. It extracts the 'query' parameter and makes a GET request to /api/v1/search-feeds/keyword/{query} on the FeedbagelClient instance.
handler: ({ query }: any, c) => c.request( "GET", `/api/v1/search-feeds/keyword/${encodeURIComponent(query)}`, ), - src/tools.ts:134-136 (schema)The input schema for search_feeds. Validates that 'query' is a string with length between 1 and 120 characters.
inputSchema: z.object({ query: z.string().min(1).max(120), }), - src/tools.ts:129-142 (registration)The full registration of the search_feeds tool in the TOOLS array. It defines the name, description, scope ('read'), inputSchema, and handler. The TOOLS array is imported by src/index.ts and used to list tools and dispatch tool calls.
{ name: "search_feeds", description: "Search the feed catalog by keyword. Matches feed titles, urls, and hostnames. Returns up to 20 results with recency stats.", scope: "read", inputSchema: z.object({ query: z.string().min(1).max(120), }), handler: ({ query }: any, c) => c.request( "GET", `/api/v1/search-feeds/keyword/${encodeURIComponent(query)}`, ), }, - src/client.ts:13-56 (helper)The FeedbagelClient helper class that provides the 'request' method used by the handler to make authenticated HTTP GET requests to the feedbagel API.
export class FeedbagelClient { private apiKey: string; private baseUrl: string; constructor(opts: ClientOptions) { if (!opts.apiKey) throw new Error("FEEDBAGEL_API_KEY is required"); this.apiKey = opts.apiKey; this.baseUrl = (opts.baseUrl ?? DEFAULT_BASE).replace(/\/$/, ""); } async request( method: string, path: string, body?: unknown, ): Promise<unknown> { const res = await fetch(`${this.baseUrl}${path}`, { method, headers: { Authorization: `Bearer ${this.apiKey}`, ...(body !== undefined ? { "content-type": "application/json" } : {}), }, body: body !== undefined ? JSON.stringify(body) : undefined, }); const text = await res.text(); let json: unknown = undefined; try { json = text ? JSON.parse(text) : undefined; } catch { json = { raw: text }; } if (!res.ok) { // Surface 429 and 4xx details verbatim so the agent sees the cap info. const err: Error & { status?: number; body?: unknown } = new Error( `HTTP ${res.status} ${res.statusText}`, ); err.status = res.status; err.body = json; throw err; } return json; } }