get_feed
Retrieve Medium articles from recommended, following, or tag-specific feeds. Specify the tab and limit to control the output.
Instructions
Read-only. Reader feed. tab='home' for recommended, 'following', or 'tag-{slug}' (e.g. 'tag-programming').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | home | |
| limit | No |
Implementation Reference
- src/medium_ops/client.py:789-826 (handler)Actual handler logic for get_feed. Queries Medium GraphQL: if tab starts with 'tag-', runs TagFeed query by slug; otherwise runs HomeFeed or FollowingFeed query via webFeed. Returns list of post objects (id, title, mediumUrl, clapCount, creator username).
def get_feed(self, *, tab: str = "home", limit: int = 20) -> list[dict[str, Any]]: """Reader feed. tab ∈ {home, following, tag-{slug}}.""" if tab.startswith("tag-"): slug = tab.split("-", 1)[1] data = self._gql( operation="TagFeed", query=""" query TagFeed($slug: String!, $paging: PagingOptions) { tag(slug: $slug) { name postsConnection(paging: $paging) { edges { node { id title mediumUrl clapCount creator { username } } } } } } """, variables={"slug": slug, "paging": {"limit": limit}}, ) edges = (((data.get("tag") or {}).get("postsConnection") or {}).get("edges")) or [] return [e["node"] for e in edges if e and e.get("node")] operation = "HomeFeed" if tab == "home" else "FollowingFeed" query = """ query %s($paging: PagingOptions) { webFeed(paging: $paging) { items { post { id title mediumUrl clapCount creator { username } } } } } """ % operation data = self._gql( operation=operation, query=query, variables={"paging": {"limit": limit}}, ) items = ((data.get("webFeed") or {}).get("items")) or [] return [i.get("post") for i in items if i.get("post")] - src/medium_ops/mcp/server.py:183-195 (schema)MCP tool registration metadata for get_feed: description ('Reader feed. tab=home, following, or tag-{slug}') and input_schema (tab string default 'home', limit integer default 20).
"get_feed": { "description": ( "Read-only. Reader feed. tab='home' for recommended, 'following', or " "'tag-{slug}' (e.g. 'tag-programming')." ), "input_schema": { "type": "object", "properties": { "tab": {"type": "string", "default": "home"}, "limit": {"type": "integer", "default": 20}, }, }, }, - src/medium_ops/mcp/server.py:465-466 (registration)Dispatch call in _dispatch() that routes tool name 'get_feed' to MediumClient.get_feed() with tab and limit from args.
if name == "get_feed": return c.get_feed(tab=args.get("tab", "home"), limit=args.get("limit", 20)) - src/medium_ops/cli.py:498-504 (registration)CLI registration: Typer command 'feed list' that calls c.get_feed(tab=tab, limit=limit).
@feed_app.command("list") def feed_list( tab: str = typer.Option("home", "--tab"), limit: int = typer.Option(20, "--limit"), ) -> None: with _client() as c: _json(c.get_feed(tab=tab, limit=limit)) - tests/test_mcp_server.py:8-20 (helper)Test that verifies get_feed is included in the set of expected MCP tools.
def test_has_core_tools(): names = set(list_tool_names()) expected = { "test_connection", "get_own_profile", "get_profile", "list_posts", "get_post", "get_post_content", "search_posts", "list_responses", "get_response_replies", "get_feed",