Skip to main content
Glama
devhub

DevHub CMS MCP

Official
by devhub

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
NameRequiredDescriptionDefault
site_idYes
titleYes
contentYes

Implementation Reference

  • 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']}
    """

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/devhub/devhub-cms-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server