create_blog_post
Generate and publish blog posts in DevHub CMS by providing title, content, and site ID for structured content management.
Instructions
Create a new blog post
Args:
site_id: Website ID where the post will be published. Prompt the user for this ID.
title: Blog post title
content: HTML content of blog post. Should not include a <h1> tag, only h2+
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_id | Yes | ||
| title | Yes | ||
| content | Yes |
Implementation Reference
- src/devhub_cms_mcp/server.py:230-257 (handler)The @mcp.tool()-decorated function implementing the create_blog_post tool. The decorator handles registration, and the docstring provides the input schema. The function creates a new blog post via the DevHub API and returns details.@mcp.tool() def create_blog_post(site_id: int, title: str, content: str) -> str: """Create a new blog post Args: site_id: Website ID where the post will be published. Prompt the user for this ID. title: Blog post title content: HTML content of blog post. Should not include a <h1> tag, only h2+ """ client, base_url = get_client() payload = { 'content': content, 'site_id': site_id, 'title': title, } r = client.post( '{}posts/'.format(base_url), json=payload, ) post = r.json() return f""" Post ID: {post['id']} Title: {post['title']} Date: {post['date']} Content (HTML): {post['content']} """