get_blog_post
Retrieve a specific blog post by its unique post ID using the MCP integration for DevHub CMS, enabling efficient content management and access.
Instructions
Get a single blog post
Args:
post_id: Blog post id
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| post_id | Yes |
Implementation Reference
- src/devhub_cms_mcp/server.py:210-228 (handler)The handler function for the 'get_blog_post' tool. It is registered via the @mcp.tool() decorator. Fetches a blog post by its ID from the DevHub CMS API, formats and returns the post details including ID, title, date, and HTML content.@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']} """