read_full_article
Extract the full content of any article using its URL. Designed for developers, this tool helps retrieve complete articles from high-quality, developer-curated blogs and newsletters.
Instructions
Returns the full content of an article identified by its URL.
Args: url: The URL of the article to read.
Returns: str: The full content of the article or an error message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
Input Schema (JSON Schema)
{
"properties": {
"url": {
"title": "Url",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
}
Implementation Reference
- src/mcp_server/server.py:63-63 (registration)Registers the 'read_full_article' tool using the FastMCP @tool decorator on the function definition.@mcp_server.tool
- src/mcp_server/server.py:64-88 (handler)Implements the core logic of the read_full_article tool: enforces API token, constructs POST request to the DevBrain API endpoint for reading the full article by URL, returns the content or an error message.def read_full_article(url: str) -> str: """Returns the full content of an article identified by its URL. Args: url: The URL of the article to read. Returns: str: The full content of the article or an error message. """ token_error = _enforce_token() if token_error: return token_error api_url = f"{api_host_base}/newsletter/article/read" headers = { "authorization": f"Bearer {_token}", "content-type": "application/json", } data = {"url": url} try: response = requests.post(api_url, headers=headers, json=data) response.raise_for_status() # Raise an HTTPError for bad responses (4xx or 5xx) return response.text except requests.exceptions.RequestException: return "Full article for the given URL is not available at this time. API error occurred - DevBrain knowledge base service is temporarily unavailable."
- src/mcp_server/server.py:64-72 (schema)Input/output schema defined by function signature (url: str -> str) and docstring describing parameters and return value for MCP tool validation.def read_full_article(url: str) -> str: """Returns the full content of an article identified by its URL. Args: url: The URL of the article to read. Returns: str: The full content of the article or an error message. """