Skip to content

Connect Dev.to to AI Agents: Automate Article Sync and Publishing

Riya Sethi Riya Sethi 10 min read AI & Agents
TrutoFor teams building AI agents

Give your AI agent Dev.to tools.

Connect Dev.to to AI agents securely using Truto's /tools endpoint. Bypass custom Dev.to integrations to programmatically fetch agent-ready schemas, bind them to LLMs, and handle rate limits safely.

In this guide

  1. 01Connect Dev.to Account
  2. 02Fetch Dev.to Tools
  3. 03Initialize the Agent SDK
  4. 04Bind Tools to LLM
  5. 05Execute Workflows

The guide

Learn how to connect Dev.to to AI Agents using Truto's /tools endpoint to automate content publishing, sync articles, and execute multi-step workflows.

You want to connect Dev.to to an AI agent so your system can autonomously draft posts, publish technical content, sync profile data, and manage article tags based on historical context. Here is exactly how to do it using Truto's /tools endpoint and SDK, bypassing the need to build and maintain a custom Dev.to connector from scratch.

Giving a Large Language Model (LLM) read and write access to your Dev.to account is an engineering headache. You either spend weeks reading API documentation, handling Markdown conversions, and writing JSON schemas, or you use a managed infrastructure layer that handles the boilerplate for you. If your team uses ChatGPT, check out our guide on connecting Dev.to to ChatGPT, or if you are building on Anthropic's models, read our guide on connecting Dev.to to Claude. For developers building custom autonomous workflows, you need a programmatic way to fetch these tools and bind them to your agent framework.

This guide breaks down exactly how to fetch AI-ready tools for Dev.to, bind them natively to an LLM using frameworks like LangChain, LangGraph, CrewAI, or the Vercel AI SDK, and execute complex developer-relations workflows. For a deeper look at the architecture behind this approach, refer to our research on architecting AI agents and the SaaS integration bottleneck.

Why a Unified Tool Layer Matters for Agent Safety

Before writing a line of integration code, decide what layer your agent will talk to. This choice determines how safe your production system will be.

Direct API tools - mapping one tool directly to raw Dev.to endpoints - seem convenient in a quick script, but they push all provider-specific quirks directly into the LLM's context window. The model has to "remember" that Dev.to requires a specific nested object for post creation, that draft states are handled via a boolean rather than an endpoint, and that you are strictly limited to exactly four tags per article. Every one of those quirks is a hallucination waiting to happen.

A unified tool layer abstracts these quirks behind stable, schema-enforced definitions. When executing a Dev.to tool calling workflow, your agent simply sees create_a_dev_to_article or update_a_dev_to_article_by_id. This yields concrete engineering wins:

  1. Smaller attack surface for hallucination. The LLM only chooses from defined function names and never invents arbitrary payload structures to satisfy the upstream provider.
  2. Deterministic input validation. Every tool has a strict JSON schema. Invalid arguments - like passing five tags to an endpoint that only accepts four - are rejected before they hit the upstream API, meaning the tool call fails fast.
  3. Framework agnosticism. Because tools are fetched dynamically via an API endpoint, you can swap out LangChain for CrewAI or Vercel AI SDK without rewriting your integration layer.

The Engineering Reality of the Dev.to API

Giving an AI agent access to external content platforms sounds simple in a Jupyter Notebook. You write a fetch request, pass an API key, and wrap it in a tool decorator. In production, this approach collapses against the realities of the Dev.to API.

If you hardcode these interactions into your agent, you will spend your sprints writing defensive integration code instead of improving your agent's reasoning loop. What makes Dev.to specifically tricky for LLMs?

The Markdown Payload Requirement

Dev.to requires content to be submitted as Markdown. While LLMs are exceptionally good at writing Markdown, the API strictly requires this Markdown to be escaped and nested inside a specific article object wrapper. An agent attempting to send a flat JSON structure like {"title": "My Post", "body_markdown": "# Hello"} will be rejected. The API expects {"article": {"title": "My Post", "body_markdown": "# Hello"}}. Truto's proxy schemas handle this nesting expectation automatically, ensuring the LLM understands exactly where to place the generated Markdown.

State Mutations via Booleans

Many content platforms use separate endpoints to publish drafts (e.g., POST /articles/{id}/publish). Dev.to does not. Publishing an article, or unpublishing a live article back to a draft, is handled entirely via the published boolean flag on the create or update payloads. This often confuses LLMs that expect an explicit publish action. Exposing a well-documented update_a_dev_to_article_by_id tool with a clear boolean parameter description is required to prevent the model from hallucinating non-existent publish endpoints.

Tag Limitations and Validation

Dev.to enforces a hard limit: articles can have a maximum of four tags. If an LLM generates a highly descriptive post and attempts to append five or six relevant tags, the Dev.to API will return an error. Without strict JSON schema validation explicitly setting a maxItems: 4 constraint on the tags array, your agent will constantly get stuck in error loops trying to publish over-tagged content.

Strict Rate Limiting and Error Handling

Dev.to enforces strict rate limits to prevent spam. When building a Dev.to AI Agents integration, how you handle HTTP 429 Too Many Requests errors is critical.

A crucial architectural note: Truto does not absorb, retry, throttle, or apply backoff on rate limit errors for you. When the Dev.to API returns an HTTP 429, Truto immediately passes that error back to the caller. However, Truto does something vital for your agent's infrastructure: it normalizes the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF specification.

It is entirely the responsibility of your application - or your agent's framework - to read these headers, pause execution, and retry the tool call.

sequenceDiagram
    participant Agent as LLM Framework
    participant Truto as Truto API
    participant DevTo as Dev.to API

    Agent->>Truto: Execute Tool (create_a_dev_to_article)
    Truto->>DevTo: POST /api/articles
    DevTo-->>Truto: HTTP 429 Too Many Requests
    Note right of Truto: Normalizes rate limit<br>headers to IETF spec
    Truto-->>Agent: HTTP 429 + Standardized Headers
    Note left of Agent: Agent framework reads headers<br>initiates exponential backoff
    Agent->>Truto: Retry Tool Execution
    Truto->>DevTo: POST /api/articles
    DevTo-->>Truto: HTTP 201 Created
    Truto-->>Agent: JSON Response

Fetching Dev.to Tools via Truto

Instead of manually defining these tool schemas, you can fetch them programmatically using Truto. Every integration on Truto is essentially a comprehensive JSON object that represents how the underlying product's API behaves. Integrations have Resources (endpoints) and Methods (operations like List, Get, Create, Update).

By connecting a Dev.to account to Truto, you generate an integrated_account_id. You then call the Truto API to retrieve all available Proxy APIs as LLM-ready tools.

curl -X GET "https://api.truto.one/integrated-account/{integrated_account_id}/tools" \
  -H "Authorization: Bearer YOUR_TRUTO_API_KEY"

This endpoint returns the descriptions and complete JSON schemas for all available Dev.to actions. Truto's SDKs wrap this endpoint to automatically register these tools with your LLM framework of choice.

Essential Dev.to Tools for Autonomous Agents

When you connect Dev.to to AI Agents via Truto, you unlock a suite of high-leverage tools. Here are the hero tools that enable complex content workflows.

1. create_a_dev_to_article

This is the core write tool. It allows the agent to generate a Dev.to article from raw Markdown. The LLM must wrap fields under the article object. Crucially, the agent can set published: false to save the output as a draft for human review, or published: true to push it live immediately. The schema strictly enforces the maximum of 4 tags.

"Draft a highly technical article about the differences between LangChain and CrewAI. Save it to my Dev.to account as a draft, and tag it with python, ai, and architecture."

2. update_a_dev_to_article_by_id

Agents need the ability to edit existing content or push a reviewed draft live. This tool allows the agent to update a specific article by its numeric ID. It is frequently used in multi-step workflows where an agent first retrieves a draft, edits the content based on feedback, and then changes the boolean flag to publish it.

"Find the draft article about LangChain and CrewAI I created yesterday. Update the title to be more SEO-friendly, rewrite the conclusion to be punchier, and publish the article."

3. list_all_dev_to_articles

To audit content, the agent must be able to see what exists. This tool lists all of the user's own Dev.to articles, including both drafts and published posts, returning the newest drafts first. This gives the agent the necessary context to avoid duplicate posts and find the numeric IDs required for updates.

"List all of my Dev.to articles. Check if I have any unpublished drafts related to Kubernetes. If I do, give me their IDs and titles."

4. get_single_dev_to_article_by_id

When an agent needs to perform a deep analysis on a specific post, this tool fetches a single published Dev.to article by its numeric ID. Note that drafts are not returned by this endpoint; agents must use the list tools to find draft data.

"Get the full text of my published Dev.to article with ID 142583. Summarize the main points so I can use them to generate a Twitter thread."

5. list_all_dev_to_me

Context is king for an AI agent. This tool retrieves the Dev.to profile of the user who owns the API key, including their ID, username, name, summary, location, and website. Agents use this to understand the persona they are writing for and to verify account connectivity before executing write operations.

"Fetch my Dev.to profile summary. Using my current bio, suggest three topics I should write about next to build authority in my niche."

For the complete tool inventory and granular schema details, visit the Dev.to integration page.

Workflows in Action

Connecting a Dev.to API AI agent goes beyond simple Q&A. Here is how specific personas use these tools to execute real-world workflows autonomously.

Scenario 1: The Automated Content Pipeline

Persona: Developer Advocate

"Check my Dev.to account for any unpublished drafts. If you find any, review the Markdown for formatting errors, ensure it has exactly 4 relevant tags, and then publish it."

Step-by-step Execution:

  1. The agent calls list_all_dev_to_articles to retrieve the user's content.
  2. It parses the JSON response, filtering for items where the published status is false.
  3. Finding a draft, it extracts the article ID and the Markdown body.
  4. The LLM analyzes the text, makes formatting corrections, and selects optimal tags.
  5. Finally, it calls update_a_dev_to_article_by_id, submitting the revised Markdown, the tags array, and setting published: true.

Outcome: The user's backlog of drafts is autonomously reviewed, formatted, optimized, and pushed live without manual intervention.

Scenario 2: Profile and Content Auditing

Persona: Technical Marketing Manager

"Review my Dev.to profile bio. Then, list all my published articles from the last month. Do the topics of my recent articles align with my profile summary? Give me a brief report."

Step-by-step Execution:

  1. The agent calls list_all_dev_to_me to extract the user's current bio and summary.
  2. The agent calls list_all_dev_to_published_articles (a variant of the list tools) to retrieve the recent live content.
  3. The LLM reads the titles and tags of the recent posts.
  4. It performs semantic analysis, comparing the actual output against the stated goals in the profile bio.

Outcome: The user receives a strategic analysis of their content alignment, generated entirely from real-time API data.

Building Multi-Step Workflows

Building an autonomous Dev.to agent requires binding these tools to an LLM and setting up a reasoning loop. Truto's approach is framework-agnostic. Whether you are using LangChain, LangGraph, CrewAI, or the Vercel AI SDK, the pattern remains the same. You fetch the tools, bind them to the model, and execute the loop.

Below is an example of how to initialize this using the TrutoToolManager from the truto-langchainjs-toolset.

import { ChatOpenAI } from "@langchain/openai";
import { AgentExecutor, createToolCallingAgent } from "langchain/agents";
import { ChatPromptTemplate } from "@langchain/core/prompts";
import { TrutoToolManager } from "@trutohq/truto-langchainjs-toolset";
 
async function runDevToAgent() {
  // 1. Initialize the LLM
  const llm = new ChatOpenAI({
    modelName: "gpt-4o",
    temperature: 0,
  });
 
  // 2. Initialize the Truto Tool Manager
  const toolManager = new TrutoToolManager({
    apiKey: process.env.TRUTO_API_KEY,
  });
 
  // 3. Fetch tools for your connected Dev.to account
  const INTEGRATED_ACCOUNT_ID = process.env.DEVTO_ACCOUNT_ID;
  const tools = await toolManager.getTools(INTEGRATED_ACCOUNT_ID);
 
  // 4. Create the prompt template
  const prompt = ChatPromptTemplate.fromMessages([
    ["system", "You are an elite developer advocate. You manage Dev.to content autonomously."],
    ["human", "{input}"],
    ["placeholder", "{agent_scratchpad}"],
  ]);
 
  // 5. Bind tools and create the agent
  const agent = createToolCallingAgent({
    llm,
    tools,
    prompt,
  });
 
  const agentExecutor = new AgentExecutor({
    agent,
    tools,
  });
 
  // 6. Execute a multi-step prompt
  const result = await agentExecutor.invoke({
    input: "Write a short blog post about building AI agents. Save it as a draft on Dev.to and tag it with AI and javascript.",
  });
 
  console.log(result.output);
}
 
runDevToAgent();

Handling Failures in the Agent Loop

Because Truto passes HTTP 429 rate limit errors directly back to the caller, your agent executor must be configured to handle these gracefully. If the Dev.to API rejects a request due to rate limiting, the agent framework receives the error and the standardized IETF headers.

Robust agent architectures use interceptors or framework-specific retry mechanics to read the ratelimit-reset header, pause the execution thread, and re-attempt the tool call. This prevents the LLM from entering a panic state and hallucinating a response when the API temporarily denies service.

graph TD
    Start["Start Workflow"] --> Fetch["Fetch Tools via Truto API"]
    Fetch --> Bind["Bind Tools to LLM (bindTools)"]
    Bind --> Prompt["User Issues Command"]
    Prompt --> Invoke["Agent Invokes Tool"]
    Invoke --> Check{Response 200?}
    Check -->|Yes| Success["Process JSON & Continue"]
    Check -->|No - 429| Backoff["Read Reset Header & Wait"]
    Backoff --> Invoke
    Check -->|No - 400| Error["Return Schema Error to LLM"]
    Error --> Invoke

Moving Forward

Building Dev.to automation AI agents doesn't have to require weeks of reading documentation and managing API state. By leveraging Truto's /tools endpoint, you abstract the engineering complexity of authentication, schema normalization, and payload formatting into a simple array of tools.

Your agents get safe, deterministic, schema-validated access to Dev.to, allowing you to focus on prompting and workflow design rather than HTTP boilerplate.

Two ways to put Dev.to to work

Truto

For product teams

Give your agent Dev.to tools

Your customers connect their own Dev.to accounts. Your product gets one API and MCP tools for Dev.to, through Truto.

FAQ

How does Truto handle Dev.to rate limits for AI agents?
Truto does not retry, throttle, or apply backoff on rate limit errors. It passes the HTTP 429 error directly back to the caller while normalizing the upstream rate limit information into standard IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). The calling agent framework must handle the retry logic.
Can an AI agent publish a Dev.to draft directly using Truto?
Yes. The agent can use the update_a_dev_to_article_by_id tool and set the published flag to true, which will immediately transition a draft to a live published article on Dev.to.
Do I need to write custom JSON schemas for Dev.to endpoints?
No. Truto's /tools endpoint automatically generates and provides the complete, LLM-ready JSON schemas for all Dev.to actions, ensuring strict validation before the request hits the API.
Which agent frameworks are supported by Truto tools?
Truto's tools are framework-agnostic. The schemas returned by the API can be natively bound to LangChain, LangGraph, CrewAI, Vercel AI SDK, or any other framework that supports OpenAI-compatible function calling.
Dev.to Dev.toAI agent tools Get a sandbox

More from our Blog