Metadata-Version: 2.5
Name: langchain-webz
Version: 0.1.0
Summary: LangChain / LangGraph tools for Webz.io News Search via the hosted MCP server
Project-URL: Homepage, https://news-search-mcp.webz.io
Project-URL: Documentation, https://news-search-mcp.webz.io
Project-URL: Issues, https://github.com/Webhose/webz-news-search/issues
Author-email: "Webz.io" <support@webz.io>
License-Expression: MIT
License-File: LICENSE
Keywords: langchain,langgraph,mcp,news,search,webz
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: langchain-core>=0.3.0
Requires-Dist: langchain-mcp-adapters>=0.1.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# langchain-webz

LangChain and LangGraph tools for [Webz.io News Search](https://news-search-mcp.webz.io).

This package does not hardcode search filters. It connects to the hosted MCP server and loads the live tool schema with `tools/list`. When the MCP adds a filter, agents see it on the next connection.

```bash
pip install langchain-webz
export WEBZ_API_TOKEN="your-webz-api-token"
```

## Direct tool call

```python
from langchain_webz import WebzNewsSearch

# env: WEBZ_API_TOKEN
tool = WebzNewsSearch()

# or pass the token in code
tool = WebzNewsSearch(api_token="your-webz-api-token")

print(tool.invoke({"query": "AI regulation Europe"}))
```

## Agent / LangGraph

```python
from langchain.agents import create_agent
from langchain_webz import get_webz_tools

tools = get_webz_tools()
agent = create_agent("openai:gpt-4.1-mini", tools)
result = agent.invoke({"messages": [{"role": "user", "content": "What is the latest EU AI news?"}]})
print(result["messages"][-1].content)
```

Inside an already running event loop, use the async helpers:

```python
from langchain_webz import aget_webz_tools, awebz_news_search

tools = await aget_webz_tools()
tool = await awebz_news_search()
```

## Config

| Name | Default | Purpose |
| --- | --- | --- |
| `WEBZ_API_TOKEN` | required | Webz API token from the dashboard |
| `WEBZ_MCP_URL` | `https://news-search-mcp.webz.io/mcp` | override for local MCP |

You can also pass `api_token=` and `mcp_url=` to the helpers.

Get a token: https://webz.io
