Skip to main content

A2A Protocol Client Tool for LangGraph

Project description

LangGraph A2A Client

A2A (Agent-to-Agent) Protocol Client Tool for LangGraph.

Overview

This library provides functionality to discover and communicate with A2A-compliant agents in LangGraph applications.

Key Features

  • Agent discovery through agent cards from multiple URLs
  • Message sending to specific A2A agents
  • LangChain tool integration for easy use in LangGraph workflows

Installation

pip install langgraph-a2a-client

Or with uv:

uv add langgraph-a2a-client

Usage

from langgraph_a2a_client import A2AClientToolProvider

# Initialize the A2A client
a2a_client = A2AClientToolProvider(
    known_agent_urls=["https://example.com/agent"],
    timeout=300,
    webhook_url="https://your-webhook.com/notify",
    webhook_token="your-webhook-token"
)

# Get the tools for use in LangGraph
tools = a2a_client.tools

# Use in your LangGraph application
# ...

API

A2AClientToolProvider

Main class that provides A2A client functionality.

Parameters

  • known_agent_urls (list[str] | None): List of A2A agent URLs to discover initially
  • timeout (int): Timeout for HTTP operations in seconds (default: 300)
  • webhook_url (str | None): Optional webhook URL for push notifications
  • webhook_token (str | None): Optional authentication token for webhook notifications

Tools

The provider exposes three tools:

  1. a2a_discover_agent: Discover an A2A agent and return its agent card
  2. a2a_list_discovered_agents: List all discovered A2A agents and their capabilities
  3. a2a_send_message: Send a message to a specific A2A agent

Examples

Basic Usage

uv run examples/basic_usage.py

Supervisor Agent Example

export OPENAI_API_KEY="your-openai-api"
uv run --extra examples examples/supervisor_agent.py

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langgraph_a2a_client-0.1.4.tar.gz (96.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langgraph_a2a_client-0.1.4-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file langgraph_a2a_client-0.1.4.tar.gz.

File metadata

File hashes

Hashes for langgraph_a2a_client-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b525d89820c9365a9044cc3918854041c7f6b1620d95d2889f6a07f6c6ee75c3
MD5 1ae2de415594dcd1ade0d5dc3f1dc89f
BLAKE2b-256 33c317f50fdff601d344d5193ee4c35f5c0c0a12fb2c4780411c852ca9510e30

See more details on using hashes here.

File details

Details for the file langgraph_a2a_client-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for langgraph_a2a_client-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 120dd2354452dba9d76d027c15b3db99b4aae0f99e3bdbd48f13fb49046036b2
MD5 bbc0e16d45c3398136b65af5f404e167
BLAKE2b-256 396435cf92d30f3d71343d63fff674c593304adc5ffd3b258351a7874a43d7f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page