Skip to main content

LangChain-compatible tools for weather, crypto, security, memory and more — works with any LangChain agent

Project description

langchain-agent-tools

LangChain-compatible tools for AI agents — weather, crypto, security, memory and more. Works with any LangChain agent out of the box.

All tools use free public APIs — no API keys required.

Installation

pip install langchain-agent-tools

Quick Start

from langchain_agent_tools import get_current_weather, check_pii, store_memory, get_token_price

# Use with any LangChain agent
from langchain.agents import create_tool_calling_agent, AgentExecutor
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(model="gpt-4o-mini")
tools = [get_current_weather, check_pii, store_memory, get_token_price]
agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools)

Available Tools

Weather (Open-Meteo, no API key)

  • get_current_weather(location) — Current temperature, humidity, wind, conditions
  • get_weather_forecast(location, days) — Forecast for up to 16 days

Crypto (CoinGecko, no API key)

  • get_token_price(token) — Current price, 24h change, market cap
  • get_token_info(token) — Detailed info, ATH/ATL, supply, links
  • get_trending_tokens() — Currently trending cryptocurrencies

Security

  • check_pii(text) — Detect emails, phones, credit cards, SSNs, IBANs in text
  • check_url_safety(url) — Analyze URL for phishing/malware indicators

Memory (Persistent)

  • store_memory(key, value) — Save key-value pairs across sessions
  • retrieve_memory(key) — Look up stored values
  • list_memories() — Show all stored memories
  • delete_memory(key) — Remove a stored key

Usage Examples

Standalone (without agent)

from langchain_agent_tools import get_current_weather, check_pii

# Weather
result = get_current_weather.invoke({"location": "Berlin"})
print(result)

# PII Check
result = check_pii.invoke({"text": "Contact me at john@example.com or 555-123-4567"})
print(result)

With LangGraph

from langgraph.prebuilt import create_react_agent
from langchain_agent_tools import get_current_weather, get_token_price, check_pii

tools = [get_current_weather, get_token_price, check_pii]
agent = create_react_agent(llm, tools)

Requirements

  • Python >= 3.10
  • langchain-core >= 0.2.0
  • httpx >= 0.27.0

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

langchain_agent_tools-0.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

langchain_agent_tools-0.1.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file langchain_agent_tools-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_agent_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for langchain_agent_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9b557edb9699abb7119843d3454dc20db9fdf947b28f9119a9e8e3e22f28c7cf
MD5 29f0ab9ce4ef4f005a262e923c9990ed
BLAKE2b-256 d400f69f312463696f0471440a5cba7baad9f57dff09ad0ab645a8e388177b32

See more details on using hashes here.

File details

Details for the file langchain_agent_tools-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_agent_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bdead89e7bf2ae57b1f0d58fb28f2757e53f9a86aef238139f563097e79f9c9b
MD5 ebfb3841171b37cbdb7888dfb523ee18
BLAKE2b-256 b2f3b35c083092db0b46a647f33dc75f31e02f85634065cb3fb4ad7a4a275a46

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