Skip to main content
Glama

create_blog_post

Generate and publish blog posts by specifying a website ID, title, and HTML content. Integrates with DevHub CMS MCP for efficient 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
contentYes
site_idYes
titleYes

Implementation Reference

  • The handler function for the 'create_blog_post' MCP tool. Decorated with @mcp.tool() for automatic registration and schema inference from type hints and docstring. Posts new blog post data to DevHub CMS API and returns post 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']} """
  • The @mcp.tool() decorator registers the create_blog_post function as an MCP tool.
    @mcp.tool()
  • Helper function to obtain authenticated DevHub API client, used by create_blog_post and other tools.
    def get_client(): """Get DevHub API client and base_url.""" client = OAuth1Session( os.environ['DEVHUB_API_KEY'], client_secret=os.environ['DEVHUB_API_SECRET']) base_url = '{}/api/v2/'.format(os.environ['DEVHUB_BASE_URL']) return client, base_url

Other Tools

Related Tools

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