get_request_feed_items
Retrieve parsed Atom feed entries for a specific FOI request, with structured fields and links to full details.
Instructions
Return parsed Atom feed entries for a specific FOI request as structured objects.
Use this instead of reading the raw wdtk://requests/{slug}/feed resource when you
want structured AtomEntry objects rather than raw XML. Each entry's link field
contains the request URL; use the slug from that URL with request_json or
authority_json for full detail.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request_slug | Yes | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- server.py:285-302 (handler)The actual handler function for get_request_feed_items. It fetches the Atom feed for a given request_slug, parses it into structured AtomEntry objects, and returns up to `limit` items.
async def get_request_feed_items( request_slug: str, limit: int = 20, ctx: Context = CurrentContext(), ) -> list[AtomEntry]: """Return parsed Atom feed entries for a specific FOI request as structured objects. Use this instead of reading the raw wdtk://requests/{slug}/feed resource when you want structured AtomEntry objects rather than raw XML. Each entry's `link` field contains the request URL; use the slug from that URL with request_json or authority_json for full detail.""" await ctx.info(f"Parsing request feed for: {request_slug}") xml_text = await wdtk.get_text( f"/request/{request_slug}/feed", accept="application/atom+xml, application/xml;q=0.9, */*;q=0.1", ) items = parse_atom(xml_text) return items[:limit] - server.py:276-283 (registration)MCP tool registration decorator for get_request_feed_items, marking it as read-only, idempotent, and tagged with 'public' and 'feed'.
@mcp.tool( annotations=ToolAnnotations( readOnlyHint=True, idempotentHint=True, openWorldHint=True, ), tags={"public", "feed"}, ) - server.py:68-74 (schema)AtomEntry Pydantic model that serves as the return type / output schema for get_request_feed_items.
class AtomEntry(BaseModel): id: str | None = None title: str | None = None link: str | None = None updated: str | None = None summary: str | None = None - server.py:147-165 (helper)parse_atom helper function that converts raw XML Atom feed text into a list of AtomEntry objects. Called by get_request_feed_items to parse the feed response.
def parse_atom(xml_text: str) -> list[AtomEntry]: ns = {"atom": "http://www.w3.org/2005/Atom"} root = ET.fromstring(xml_text) entries: list[AtomEntry] = [] for entry in root.findall("atom:entry", ns): link_el = entry.find("atom:link", ns) summary_el = entry.find("atom:summary", ns) entries.append( AtomEntry( id=(entry.findtext("atom:id", default=None, namespaces=ns)), title=(entry.findtext("atom:title", default=None, namespaces=ns)), link=(link_el.get("href") if link_el is not None else None), updated=(entry.findtext("atom:updated", default=None, namespaces=ns)), summary=("".join(summary_el.itertext()).strip() if summary_el is not None else None), ) ) return entries - tests/smoke_test.py:86-89 (registration)Smoke test probe that invokes get_request_feed_items during testing to verify the tool works correctly.
Probe( tool="get_request_feed_items", args={"request_slug": "a_request_about_facial_recogni", "limit": 20}, note="Feed items — known active request; error expected if slug stale",