Skip to main content
Glama

create_article

Publish articles to Dev.to by providing title, markdown content, tags, and publication status.

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
titleYes
body_markdownYes
tagsNo
publishedNo

Implementation Reference

  • The main handler function for the 'create_article' MCP tool. It is decorated with @mcp.tool() which registers it. The function signature and docstring define the input schema. It sends a POST request to Dev.to API to create an article with the given parameters and returns the article ID and URL.
    @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')}"
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'publish' behavior and the draft/published option, but lacks critical details: authentication requirements, rate limits, what happens on failure, whether articles are editable after publishing, or response format. For a write operation with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Perfectly structured and concise. The first sentence states the purpose, followed by a clear 'Args:' section with bullet-point explanations. Every sentence earns its place, with no redundant information. The formatting makes it easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Incomplete for a write operation with no annotations or output schema. While parameters are well-explained, missing critical context: authentication needs, error handling, response format, and behavioral constraints (e.g., tag limits, publishing consequences). The description doesn't compensate for the lack of structured metadata.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It provides clear semantics for all 4 parameters: title (article title), body_markdown (content in markdown), tags (comma-separated list with example), and published (immediate vs draft). This adds substantial value beyond the bare schema, though it doesn't cover all edge cases (e.g., tag limits).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Create and publish a new article on Dev.to' - a specific verb (create/publish) and resource (article). It distinguishes from siblings like get_article_by_id or update_article by focusing on creation rather than retrieval or modification. However, it doesn't explicitly contrast with all siblings (e.g., update_article could also involve publishing).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. While the purpose implies creation, there's no mention of prerequisites (e.g., authentication needs), when not to use it (e.g., for updating existing articles), or explicit alternatives like update_article for modifications. The agent must infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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