update_blog_post
Modify and update existing blog posts in the DevHub CMS system by specifying the post ID, title, and content. Ensures accurate and timely content management.
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
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | ||
| post_id | Yes | ||
| title | No |
Implementation Reference
- src/devhub_cms_mcp/server.py:260-287 (handler)The handler function for the 'update_blog_post' tool. It is decorated with @mcp.tool(), which registers it with the MCP server. The function updates the title and/or content of a blog post via the DevHub CMS API.@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']} """