follow_feed
Add a feed to your follow list using its numeric feed ID. Idempotent operation that counts toward your subscription cap.
Instructions
[write] Add a feed to the user's follow list. Idempotent. Counts against the subscription cap.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| feed_id | Yes | Numeric feed id |
Implementation Reference
- src/tools.ts:42-43 (handler)The handler for follow_feed calls the FeedbagelClient.request method with POST to /api/v1/follow, passing the input object (containing feed_id) as the body.
handler: (input, c) => c.request("POST", "/api/v1/follow", input), }, - src/tools.ts:19-21 (schema)Input schema for follow_feed: expects a positive integer feed_id.
const FeedIdInput = z.object({ feed_id: z.number().int().positive().describe("Numeric feed id"), }); - src/tools.ts:36-43 (registration)The follow_feed tool is defined in the TOOLS array with name 'follow_feed', description, scope 'write', FeedIdInput schema, and the handler.
{ name: "follow_feed", description: "Add a feed to the user's follow list. Idempotent. Counts against the subscription cap.", scope: "write", inputSchema: FeedIdInput, handler: (input, c) => c.request("POST", "/api/v1/follow", input), }, - src/client.ts:23-55 (helper)The FeedbagelClient.request helper that follow_feed's handler delegates to — sends an HTTP request with Bearer auth and JSON body to the feedbagel API.
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; }