get_blog_post
Retrieve a specific blog post from the DevHub CMS by providing its unique post ID to access content details.
Instructions
Get a single blog post
Args:
post_id: Blog post id
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"post_id": "<post_id>"
},
"name": "get_blog_post"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| post_id | Yes |
Implementation Reference
- src/devhub_cms_mcp/server.py:210-227 (handler)The handler function for the 'get_blog_post' tool. It fetches a blog post by its ID from the DevHub CMS API using an authenticated client and returns a formatted string with the post ID, title, date, and HTML content. The @mcp.tool() decorator also serves as the registration mechanism in FastMCP.
@mcp.tool() def get_blog_post(post_id: int) -> str: """Get a single blog post Args: post_id: Blog post id """ client, base_url = get_client() r = client.get('{}posts/{}/'.format(base_url, post_id)) post = r.json() return f""" Post ID: {post['id']} Title: {post['title']} Date: {post['date']} Content (HTML): {post['content']} """