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
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
Connect LangChain in 10 minutes
Create an API key
Settings → API Keys in Schedule & Chill. Store it as SCHEDULENCHILL_API_KEY in your environment, not in code.
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.
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.
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.
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.
Python — a schedule_post tool
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 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.
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.
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.
Yes. The tools are ordinary LangChain tools, so they pass straight into create_react_agent or any custom LangGraph node that calls tools.
Call GET /api/capabilities or the get_accounts MCP tool at the start of the run and put the result in context. Never let the model guess account ids.
Use the REST API when the agent needs one narrow capability and you want tight control over the schema. Use the MCP server when the agent needs the full surface — scheduling, media, queue reads, stats — because you get every tool from one connection.
Schedule instead of publishing. Give the tool a future scheduled_at so there is a review window, and add a human-in-the-loop interrupt in LangGraph before the publishing node runs.
Yes. Anything that can call an HTTP endpoint or speak MCP works the same way — the API is framework-agnostic and the MCP server is a standard streamable HTTP server.
Last reviewed July 26, 2026
Connect a different tool
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 freeFree · No credit card · No trial timer