Wrong API Endpoint Made MCP Tool Return Drafts Instead of Published Articles
A developer discovered that a DEV.to MCP server tool called list_articles was silently returning unpublished drafts instead of published articles due to a wrong API endpoint. The tool's docstring promised published articles, but the underlying code called /articles/me, which returns all articles with drafts sorted first, rather than the correct /articles/me/published endpoint. Because the default page size was set to 10, any account holding 10 or more drafts would receive only drafts in the response, with no error or empty-list signal to indicate something was wrong. The bug went undetected across multiple code audits because the tool had never actually been executed in the developer's sandbox environment. The issue was confirmed through a reproducible test using a stubbed fixture, and fixed by updating the endpoint to /articles/me/published.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in