PullMD Part 6: Setup for Agents – Simply Explained
One afternoon I sat down to tidy up the interface. What came out of it was a help page, a download for AI assistants, and the embarrassing realisation that something I had claimed about my own service was wrong.
Why a Help Page
An agent, in this context, is an AI assistant that acts on your behalf. You tell it what you want, and it figures out which tools to use. Claude Code is one of those agents. When an agent talks to PullMD, it needs to know things like: how long does a result stay fresh? What parameters can I pass? What format comes back?
The idea came up while we were talking about share links and how long they actually live, and the second half of what I said turned out to be the more useful part:
“Ah, interesting, so an AI agent could fetch a subreddit link again and again and would always have the newest posts, or the ones on the page at least… cool. We should write that kind of information onto a built-in help page, because you forget things like this and after a few weeks or months you don’t know any more. A lot of projects don’t have that.”
I forget those things myself. After a few weeks I can’t remember whether a cached result (a stored copy the service keeps so it doesn’t have to fetch the same page twice) lasts an hour or a day. And then I just try it out instead of looking it up. Having a /help page inside the service itself seemed obviously useful.
So I built one. Bilingual, in the same design as the rest, covering the details you forget:
- How long a result stays fresh and when it gets fetched again
- How long a share link lives
- Which parameters the endpoint understands, the endpoint being the address a program calls to get data
- How the service tells the difference between a browser, the app and an AI assistant asking
Setup for AI Assistants
The help page also got something I hadn’t put anywhere before: a section explaining how to set the service up for agents. Two text boxes to copy. One is a ready-made instruction you can paste in front of any chatbot. The other is the skill from Part 4 as a ZIP file (a compressed download containing the skill’s nine small files, ready to unpack).
The ZIP is created automatically from the skill directory whenever the container (the sealed box the program runs in on the server) is built. Nine files, nine kilobytes. Unpack it and everything is already in place, with nothing to gather by hand.
For MCP (Model Context Protocol, a newer way for AI assistants to connect to external tools) the page said “coming soon”. That’s the story of Part 7.
The Claim That Wasn’t True
Here is where it got interesting. While writing the help page, I thought that idea through once more: that an agent could fetch a subreddit link (a link pointing to a Reddit community page) again and again and always get the newest posts. It sounded great, except it didn’t work that way at all.
“The share link only really makes sense if I can use it to pull the content fresh again and again. Otherwise I don’t need the share link, I already have the old text.”
A share link is a short identifier that lets you call up previously fetched content without typing the full original address. Up to that point, though, a share link was a snapshot. You called it and got exactly what was there on the first fetch.
For sending someone an article, that’s fine. For an agent that wants to know what’s happening in a subreddit right now, it’s useless, because the content stays frozen in time. So the error wasn’t in the code, it was in what I had confidently written down half an hour earlier.
Making Share Links Stay Current
The fix was small but changed how the whole feature works. Now, when a share link is called, the service checks how old the stored copy is. If it’s older than an hour, it fetches the source again and writes the new version back. The identifier stays the same.
Two details mattered. First, the service has to figure out from the old stored text whether comments were included originally and which language the answer was in. Otherwise the refreshed version returns something different from what was there the first time.
Second, if the source is gone or the network is down, the service keeps serving the old version. A share link that suddenly returns a 404, the error meaning “page not found”, would be worse than one showing slightly stale content.
That way an agent only needs to know a short identifier. No full address to manage, no parameters to remember. Call it once, and what comes back is current.
That this very feature would become one of three tools for Claude two hours later wasn’t planned at that point.
Part 6 of 15 in the PullMD series.
← PullMD Part 5: Measuring the Wrong Engine | PullMD Part 7: The MCP Server →