Skip to main content
Glama

update_article

Modify existing Dev.to articles by updating titles, content, tags, or publish status using article ID.

Instructions

Update an existing article on Dev.to

Args:
    article_id: The ID of the article to update
    title: New title for the article (optional)
    body_markdown: New content in markdown format (optional)
    tags: New comma-separated list of tags (optional)
    published: Change publish status (optional)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
article_idYes
titleNo
body_markdownNo
tagsNo
publishedNo

Implementation Reference

  • The core handler function for the 'update_article' MCP tool. It is registered via the @mcp.tool() decorator. The function fetches the existing article, updates only the provided fields, sends a PUT request to the Dev.to API, and returns a success message with the updated URL.
    @mcp.tool()
    async def update_article(article_id: int, title: str = None, body_markdown: str = None, 
                            tags: str = None, published: bool = None) -> str:
        """
        Update an existing article on Dev.to
        
        Args:
            article_id: The ID of the article to update
            title: New title for the article (optional)
            body_markdown: New content in markdown format (optional)
            tags: New comma-separated list of tags (optional)
            published: Change publish status (optional)
        """
        # First get the current article data
        article = await fetch_from_api(f"/articles/{article_id}")
        
        # Prepare update data with only the fields that are provided
        update_data = {"article": {}}
        if title is not None:
            update_data["article"]["title"] = title
        if body_markdown is not None:
            update_data["article"]["body_markdown"] = body_markdown
        if tags is not None:
            update_data["article"]["tags"] = tags
        if published is not None:
            update_data["article"]["published"] = published
        
        async with httpx.AsyncClient() as client:
            response = await client.put(f"{BASE_URL}/articles/{article_id}", json=update_data, timeout=10.0)
            response.raise_for_status()
            updated_article = response.json()
        
        return f"Article updated successfully\nURL: {updated_article.get('url')}"
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it implies a mutation operation ('Update'), it doesn't mention permission requirements, whether changes are reversible, rate limits, or what happens to fields not specified. This leaves significant gaps for a tool that modifies content.

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?

The description is efficiently structured with a clear opening statement followed by a well-organized parameter list. Every sentence adds value without redundancy, and the formatting makes it easy to scan. It's appropriately sized for a tool with 5 parameters.

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

Completeness3/5

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

For a mutation tool with no annotations and no output schema, the description does well on parameter semantics but lacks important behavioral context. It doesn't explain what the tool returns, error conditions, or authentication requirements. The parameter explanations are strong, but other critical aspects are missing.

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?

The description provides clear explanations for all 5 parameters beyond their schema titles, including optionality notes and format hints (e.g., 'comma-separated list of tags', 'markdown format'). Since schema description coverage is 0%, this description fully compensates by adding meaningful semantic context for each parameter.

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 the action ('Update') and resource ('an existing article on Dev.to'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from its sibling 'create_article' beyond the 'existing' qualifier, which is why it doesn't reach a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'create_article' or other article-related tools. It lacks context about prerequisites (e.g., authentication needs) or scenarios where this tool is appropriate versus other operations.

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