Catalog PyPI
Back to packageRELEASE DETAILS

0.1.0

PyPI

agentdraft-langchain

LangChain tools for AgentDraft — let LangChain, LangGraph, CrewAI, and AutoGen agents book calendars through the coordination layer without colliding.

agentdraftagentsai-agentsautogencalendarcrewailangchainlanggraphschedulingtools
Published23 May 2026
Direct dependencies3
Transitive dependenciesNot calculated

README

Version 0.1.0 documentation

agentdraft-langchain — LangChain tools for AgentDraft

PyPI Python License: MIT

LangChain tools that let an agent book calendars through AgentDraft — the coordination layer for AI scheduling agents — so two agents racing for the same slot resolve to a single deterministic winner instead of double-booking your calendar.

Each tool is a langchain_core.tools.BaseTool: LangChain and LangGraph consume it directly, CrewAI accepts LangChain tools natively, and AutoGen uses it through its LangChainToolAdapter.

Install

pip install agentdraft-langchain

Requires Python 3.9+, langchain-core>=0.3, and a valid avs_live_… agent key from the AgentDraft dashboard.

Quickstart

from agentdraft_langchain import get_agentdraft_tools

# Reads AGENTDRAFT_API_KEY (and optional AGENTDRAFT_BASE_URL) from the env.
tools = get_agentdraft_tools()

# Hand `tools` to any langchain-core-compatible agent. With LangGraph:
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI

agent = create_react_agent(ChatOpenAI(model="gpt-4o"), tools)
agent.invoke({"messages": [("user", "Book me a 30-min call tomorrow at 2pm UTC.")]})

get_agentdraft_tools() returns two tools: agentdraft_get_availability and a booking tool. By default the booking tool is conflict-aware — see below.

The tools

ToolnamePurpose
AvailabilityToolagentdraft_get_availabilityList the slots open to this agent between two times
ConflictAwareBookingToolagentdraft_commit_booking_safeCommit a booking; on a lost race, return guidance instead of raising
BookingToolagentdraft_commit_bookingCommit a booking; raise ToolException if outranked

All times are ISO 8601 strings (2026-06-01T14:00:00Z). The booking tools accept an optional idempotency_key for safe retries.

You can also construct tools directly against an explicit client:

from agentdraft import Client
from agentdraft_langchain import AvailabilityTool, ConflictAwareBookingTool

client = Client(api_key="avs_live_...")
tools = [AvailabilityTool(client=client), ConflictAwareBookingTool(client=client)]

How a lost race surfaces

When two agents race for the same slot, exactly one wins. The booking tools differ only in how the losing agent finds out:

  • ConflictAwareBookingTool (default in get_agentdraft_tools()) returns a plain-language message so the LLM can react:

    OUTRANKED — your booking was not committed. A higher-priority agent
    (agent_id=agt_sales, priority=1) already holds this slot
    (winning_booking_id=bkg_…). Your priority is 3. Do not retry the same
    slot — call agentdraft_get_availability and propose a different time
    to your user.
    

    An autonomous agent reads this and proposes an alternate slot.

  • BookingTool raises langchain_core.tools.ToolException with the same message. Use it when you want the surrounding framework to handle the failure explicitly.

A lost race is a normal, expected outcome of a coordination layer — not a bug. Prefer the conflict-aware tool for agents that run unattended.

Use with CrewAI / AutoGen

CrewAI accepts LangChain tools directly — pass the list get_agentdraft_tools() returns to a CrewAI Agent(tools=...). AutoGen wraps each tool with LangChainToolAdapter from autogen_ext.tools.langchain. Either way the conflict semantics are identical to the LangChain path.

How this differs from the other AgentDraft packages

agentdraft (SDK)agentdraft-langchainagentdraft-mcp
CallerApp code you wroteA LangChain-family agentAn MCP host (Claude Desktop, etc.)
SurfaceClient methodsBaseTool objectsMCP tools over stdio
ConflictConflict exceptionMessage or ToolExceptionStructured JSON result

All three wrap the same REST API with the same auth and semantics.

Security

Found a vulnerability? See https://agentdraft.io/security — do not open a public issue for a security report.

Contributing

See CONTRIBUTING.md. This package lives inside the GipsyChef/agentdraft monorepo under sdks/langchain/.

License

MIT — see https://agentdraft.io/legal/license.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 3

Native requirements
3 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
agentdraft
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
agentdraft>=0.1.0runtime
langchain-core
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
langchain-core>=0.3runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest>=8.3.0; extra == "dev"runtime

Distribution files

2 collected
agentdraft_langchain-0.1.0-py3-none-any.whl

bdist_wheel · 7.86 KB · Python py3

Source file
agentdraft_langchain-0.1.0.tar.gz

sdist · 8.23 KB · Python source

Source file

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:49 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:97ad97bf9f75be159e9615da8e4be567bdf61acd41e8d10a2839ff87d8fc7a0e

Other collected versions

View all collected versions →