Skip to main content
Glama
devhub

DevHub CMS MCP

Official
by devhub

update_blog_post

Modify existing blog posts in DevHub CMS by updating titles and HTML content while maintaining proper heading structure.

Instructions

Update a single blog post

Args:
    post_id: Blog post ID
    title: Blog post title
    content: HTML content of blog post. Should not include a <h1> tag, only h2+

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
post_idYes
titleNo
contentNo

Implementation Reference

  • The handler function decorated with @mcp.tool(), which registers and implements the update_blog_post tool. It conditionally updates the title and/or content of a blog post via the DevHub API and returns the updated post details.
    @mcp.tool()
    def update_blog_post(post_id: int, title: str = None, content: str = None) -> str:
        """Update a single blog post
    
        Args:
            post_id: Blog post 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 = {}
        if content:
            payload['content'] = content
        if title:
            payload['title'] = title
        r = client.put(
            '{}posts/{}/'.format(base_url, post_id),
            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