Skip to main content
Glama

create_article

Generate and publish articles on Dev.to by specifying a title, markdown content, tags, and publication status. Ideal for automating content creation and managing drafts or live posts.

Instructions

Create and publish a new article on Dev.to Args: title: The title of the article body_markdown: The content of the article in markdown format tags: Comma-separated list of tags (e.g., "python,tutorial,webdev") published: Whether to publish immediately (True) or save as draft (False)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
body_markdownYes
publishedNo
tagsNo
titleYes

Implementation Reference

  • The main handler function for the 'create_article' tool, decorated with @mcp.tool() for registration. It creates a new article on Dev.to using the provided title, body_markdown, tags, and published status by posting to the Dev.to API.
    @mcp.tool() async def create_article(title: str, body_markdown: str, tags: str = "", published: bool = False) -> str: """ Create and publish a new article on Dev.to Args: title: The title of the article body_markdown: The content of the article in markdown format tags: Comma-separated list of tags (e.g., "python,tutorial,webdev") published: Whether to publish immediately (True) or save as draft (False) """ article_data = { "article": { "title": title, "body_markdown": body_markdown, "published": published, "tags": tags } } async with httpx.AsyncClient() as client: response = await client.post(f"{BASE_URL}/articles", json=article_data, headers={"Content-Type": "application/json", "api-key": os.getenv("DEV_TO_API_KEY")}, timeout=10.0) response.raise_for_status() article = response.json() return f"Article created successfully with ID: {article.get('id')}\nURL: {article.get('url')}"

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/Arindam200/devto-mcp'

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