LangChain calendar tools that don't double-book.
agentdraft-langchain drops two calendar tools into any langchain-core-compatible agent. They check availability, commit bookings, and surface lost races as plain-language messages the LLM can react to — backed by AgentDraft's storage-level conflict engine so two agents on the same calendar resolve to a single deterministic winner.
Updated
pip install agentdraft-langchain
Requires Python 3.9+ and langchain-core >= 0.3. Set AGENTDRAFT_API_KEY to an avs_live_… agent key from the dashboard.
from agentdraft_langchain import get_agentdraft_tools
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
tools = get_agentdraft_tools() # reads AGENTDRAFT_API_KEY
agent = create_react_agent(ChatOpenAI(model="gpt-4o"), tools)
agent.invoke({"messages": [
("user", "Book me a 30-min call tomorrow at 2pm UTC."),
]})Two tools land on the agent: agentdraft_get_availability and agentdraft_commit_booking_safe. Both are BaseTool subclasses, so LangGraph accepts them directly and AutoGen takes them through LangChainToolAdapter. CrewAI does not — see the CrewAI page for the twenty-line native tool it wants instead.
| Tool | Tool name | Purpose |
|---|---|---|
| AvailabilityTool | agentdraft_get_availability | List the slots open to this agent between two times. |
| ConflictAwareBookingTool | agentdraft_commit_booking_safe | Commit a booking. On a lost race, return a plain-language message instead of raising — the LLM picks another slot. |
| BookingTool | agentdraft_commit_booking | Commit a booking. On a lost race, raise ToolException — for graphs that handle conflicts in code, not in the LLM. |
Most LangChain calendar tools we've seen call the underlying calendar API directly — typically Google Calendar or Calendly. That works for one agent. With two agents on the same calendar, the calendar API has no notion of "the other agent that was about to write here," so both agents succeed in writing and the human gets overlapping events. The multi-agent calendar collision is the predictable consequence.
agentdraft-langchain sends every booking through AgentDraft's coordination layer first. The conflict engine resolves the race against every other agent on that user's calendar at the storage layer — a single TransactWriteItems with conditional writes per time bucket — and only the winner ever reaches the underlying calendar. Lost races surface as a typed 409 with the winner's identity, priority, and audit reference.
Because each tool is a langchain_core.tools.BaseTool:
- LangChain & LangGraph — pass the tool list to any agent constructor that accepts tools (create_react_agent, AgentExecutor, etc.).
- AutoGen — wrap each tool with LangChainToolAdapter from autogen-ext and register them with the AssistantAgent.
- CrewAI — not this package. CrewAI validates Agent(tools=…) against its own crewai.tools.BaseTool and rejects LangChain tools, so subclass that instead: CrewAI calendar tools .
- No framework — install agentdraft directly and call client.bookings.create(...).
Frequently asked
Which agent frameworks does agentdraft-langchain work with?
Anything built on langchain-core ≥ 0.3 — LangChain itself, LangGraph, and AutoGen through its LangChainToolAdapter. CrewAI is the exception: it only accepts its own crewai.tools.BaseTool, so use the native CrewAI tools there.
What happens when two LangChain agents race for the same slot?
AgentDraft's conflict engine resolves the race at the storage layer via a single conditional write. Exactly one writer wins; the losing tool call returns a plain-language message the LLM can read (e.g. "that slot is taken by Agent X, priority 2 — pick another") instead of an exception.
Do I need a paid AgentDraft account to use the LangChain tools?
You need an AgentDraft account. Individual starts at $10/month for one user and up to three agents; Team is $25/month when multiple agents need shared priority resolution.
- Why AI scheduling agents collide — and what a coordination layer looks like — the protocol-level case for AgentDraft.
- How a deterministic conflict engine resolves 8,217 collisions — what happens under the ConflictAwareBookingTool.
- Calendar API for AI agents — the underlying HTTP surface these tools call.