get_host_metadata
Retrieve metadata including title, description, favicon, and feed list for any host domain.
Instructions
[read] Get metadata (title, description, favicon, feed list) for a host domain.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes |
Implementation Reference
- src/tools.ts:157-169 (schema)Definition of get_host_metadata tool with input schema (host string 1-200 chars) and handler that calls GET /api/v1/host/{host}/metadata
{ name: "get_host_metadata", description: "Get metadata (title, description, favicon, feed list) for a host domain.", scope: "read", inputSchema: z.object({ host: z.string().min(1).max(200), }), handler: ({ host }: any, c) => c.request( "GET", `/api/v1/host/${encodeURIComponent(host)}/metadata`, ), - src/tools.ts:165-169 (handler)Handler function for get_host_metadata: makes GET request to /api/v1/host/{encoded host}/metadata via FeedbagelClient
handler: ({ host }: any, c) => c.request( "GET", `/api/v1/host/${encodeURIComponent(host)}/metadata`, ), - src/index.ts:37-43 (registration)Registration: TOOLS array (including get_host_metadata) is exported and mapped into MCP ListTools response
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS.map((t) => ({ name: t.name, description: `[${t.scope}] ${t.description}`, inputSchema: zodToJsonSchema(t.inputSchema, { target: "openApi3" }), })), })); - src/client.ts:23-55 (helper)FeedbagelClient.request() — the HTTP helper called by get_host_metadata's handler
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; }