AI agent framework10 minutes setup

Post to social media from LangChain

A LangChain agent can post to social media by calling the Schedule & Chill REST API from a @tool function, or by loading the MCP server through langchain-mcp-adapters. Either path gives the agent scheduling, media, and queue tools across LinkedIn, Bluesky, Mastodon and YouTube without writing platform OAuth code.

Free · No credit card · No trial timer

The short answer

Two paths: a ~15-line @tool wrapping POST /api/posts, or langchain-mcp-adapters pointed at the MCP endpoint for all 22 tools at once.

How it connects
REST API tool or MCP adapter
Publishes to
LinkedIn, Bluesky, Mastodon and YouTube
Setup

Connect LangChain in 10 minutes

  1. Create an API key

    Settings → API Keys in Schedule & Chill. Store it as SCHEDULENCHILL_API_KEY in your environment, not in code.

  2. Pick your path

    For one narrow capability, write a @tool that wraps POST /api/posts. For a full agent that browses media and manages a queue, load the MCP server instead — you get every tool without writing wrappers.

  3. Fetch account ids once

    Call GET /api/capabilities at startup and cache the connected account ids, so the model picks from a known list instead of hallucinating ids.

  4. Bind the tools to your agent

    Pass the tool list into create_react_agent (LangGraph) or your AgentExecutor. Keep the docstring precise — it is the only thing the model reads to decide when to post.

  5. Gate the destructive path

    Publishing is irreversible. Default the tool to scheduling with a future timestamp, and require a human approval step before publish_now.

Copy this

Python — a schedule_post tool

python
import os
import requests
from langchain_core.tools import tool

API = "https://schedulenchill.com/api"
HEADERS = {
    "Authorization": f"Bearer {os.environ['SCHEDULENCHILL_API_KEY']}",
    "Accept": "application/json",
}


@tool
def schedule_post(content: str, account_ids: list[int], scheduled_at: str) -> dict:
    """Schedule a social media post.

    content: the post text. X caps a post at 280 characters, but counts
        every link as 23 whatever its length and every emoji as 2, so budget
        for that before you hit send.
    account_ids: connected account ids to publish to.
    scheduled_at: ISO 8601 UTC timestamp in the future, e.g. 2026-08-01T14:00:00Z.
    """
    response = requests.post(
        f"{API}/posts",
        headers=HEADERS,
        json={
            "content": content,
            "social_account_ids": account_ids,
            "scheduled_at": scheduled_at,
        },
        timeout=30,
    )
    response.raise_for_status()
    return response.json()


# Or load every MCP tool at once:
# from langchain_mcp_adapters.client import MultiServerMCPClient
# client = MultiServerMCPClient({
#     "schedulenchill": {
#         "url": "https://schedulenchill.com/mcp",
#         "transport": "streamable_http",
#         "headers": HEADERS,
#     }
# })
# tools = await client.get_tools()
What it does

What LangChain can and cannot do

What you can do

  • Schedule or publish from inside an agent loop
  • Load all 22 MCP tools at once with langchain-mcp-adapters
  • Per-platform copy so one idea adapts to X and LinkedIn
  • Browse and attach media library assets
  • Read the queue so the agent knows what is already planned
  • Cancel a scheduled post the agent decides against

Where it stops

  • There is no first-party langchain-schedulenchill package. You write the @tool wrapper, or use the MCP adapter, which is maintained by LangChain.
  • Publishing cannot be undone once a platform accepts the post. Prefer scheduling with a delay so a human can cancel.
  • Account ids are workspace-specific. Fetch them at runtime instead of hardcoding them in a prompt.
Use cases

What people build with it

Research-and-post agent

The agent reads your docs or a news feed, drafts a take, checks the existing queue for overlap, then schedules it for the next open slot.

Multi-agent content team

A LangGraph writer node drafts, an editor node critiques, and a publisher node calls schedule_post only after the editor approves.

Customer-facing social features

Your SaaS embeds an agent that lets your own users publish to their accounts, with Schedule & Chill handling every platform OAuth flow.

FAQ

LangChain questions

Wrap the Schedule & Chill REST API in a LangChain @tool that POSTs to https://schedulenchill.com/api/posts with a bearer token, then bind that tool to your agent. Alternatively, load the MCP server with langchain-mcp-adapters to get all 22 tools without writing wrappers.

Last reviewed July 26, 2026

Wire LangChain up in 10 minutes

It is free — no card, no trial timer. Make real API calls, connect your account, and see it work.

Start free

Free · No credit card · No trial timer