omnifeed

tools

import "github.com/kinorai/omnifeed/internal/transport/mcp/tools"

Package tools defines the MCP tools this proxy exposes — fetch_url and web_search. Each constructor binds a use case (the engine registry or a searcher) to an mcp.Tool, so the MCP server stays a pure JSON-RPC transport and adding a tool never touches the protocol plumbing.

Index

Constants

MaxFetchChars is the ceiling on fetch_url’s `max_chars`, and the value declared to clients as `anthropic/maxResultSizeChars`. 500000 is the maximum that annotation accepts, so a caller can never ask for more text than the client is willing to render.

const MaxFetchChars = 500000

func FetchURL

func FetchURL(reg *engine.Registry, defaults reddit.Options, metrics *observability.Metrics, defaultMaxChars int) mcp.Tool

FetchURL returns the `fetch_url` tool: URL → LLM-friendly content via the engine registry (Reddit engine for reddit.com, Hacker News engine for news.ycombinator.com, crawl4ai fallback for the rest). defaultMaxChars caps markdown content when the caller omits `max_chars` (0 = unlimited); it comes from OMNIFEED_FETCH_MAX_CHARS.

func WebSearch

func WebSearch(searcher domain.Searcher, maxResults int, metrics *observability.Metrics) mcp.Tool

WebSearch returns the `web_search` tool: query → result URLs via the configured Searcher (SearXNG). Results feed the `fetch_url` tool, which renders any returned URL — reddit.com hits come back as full TOON comment trees.

Generated by gomarkdoc