Metadata-Version: 2.5
Name: langchain-stackresolve
Version: 0.1.0
Summary: LangChain tools for StackResolve: find, compare, and audit software for AI agents, plus structured company research.
Project-URL: Homepage, https://stackresolve.dev
Project-URL: Repository, https://github.com/autorevai/stackresolve
Project-URL: Documentation, https://stackresolve.dev/docs
Author: StackResolve
License: MIT
License-File: LICENSE
Keywords: agent-tools,agentready,ai-agents,companydata,langchain,mcp,stackresolve
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: langchain-core>=0.3.0
Requires-Dist: pydantic>=2.0
Requires-Dist: stackresolve>=0.1.0
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.23; extra == 'test'
Requires-Dist: pytest>=7.0; extra == 'test'
Description-Content-Type: text/markdown

# langchain-stackresolve

LangChain tools for [StackResolve](https://stackresolve.dev): web intelligence for AI agents.

Pick software for a task, compare vendors, check whether a product is agent-ready, and
pull structured company facts. One tool call instead of a search-and-scrape loop.

```bash
pip install langchain-stackresolve
```

## Quickstart

Every tool works without a key, subject to an anonymous rate limit. A free key from
[stackresolve.dev/developers](https://stackresolve.dev/developers) raises it.

```python
import os
from langchain_stackresolve import StackResolveToolkit
from langchain.agents import create_agent

os.environ["STACKRESOLVE_API_KEY"] = "ar_..."  # optional, raises the rate limit

agent = create_agent(
    model="claude-sonnet-5",
    tools=StackResolveToolkit().get_tools(),
)

result = agent.invoke({
    "messages": [{
        "role": "user",
        "content": "I need to scrape javascript-heavy sites. What should I use, "
                   "and what does it cost?",
    }]
})
print(result["messages"][-1].content)
```

The agent calls `stackresolve_find_tools` to get scored candidates, then
`stackresolve_get_pricing` on the winner. Two calls, structured answers, no scraping.

## Single tools

Import only what you need:

```python
from langchain_stackresolve import StackResolveAudit, StackResolveFindTools

audit = StackResolveAudit()
print(audit.invoke({"domain": "stripe.com"}))

find = StackResolveFindTools()
print(find.invoke({"task": "send transactional email from a Node service"}))
```

## Tools

| Tool | What it answers |
|---|---|
| `stackresolve_find_tools` | "What should I use for this task?" Ranked, with AgentReady scores. |
| `stackresolve_search_tools` | Registry search filtered on API, MCP, CLI, OpenAPI, or self-serve. |
| `stackresolve_compare_products` | Side-by-side on scores, capabilities, and pricing. |
| `stackresolve_audit` | 0-100 agent-readiness score for a domain, plus failing checks. |
| `stackresolve_get_company` | Structured company facts from a domain. |
| `stackresolve_get_pricing` | Current plans and prices as structured data. |
| `stackresolve_find_competitors` | Competitors, with how each one differs. |
| `stackresolve_research_company` | Deep research with sources, answering a question. |

All eight work without a key, subject to an anonymous rate limit. A free key raises the
limit and is required for account endpoints (monitors, usage, discovery runs), which this
package does not expose.

## Configuration

The toolkit and every tool accept `api_key` and `base_url`, and otherwise read
`STACKRESOLVE_API_KEY` and `STACKRESOLVE_BASE_URL` from the environment.

```python
toolkit = StackResolveToolkit(api_key="ar_...")
```

Pass an existing SDK client to share connection state:

```python
from stackresolve import StackResolve

client = StackResolve(api_key="ar_...")
tools = StackResolveToolkit(client=client).get_tools()
```

## Errors

Tools return a readable message rather than raising, so a failed call does not end the
agent's turn. A missing key, an exhausted allowance, and a rate limit each come back as
text the model can act on.

## Output size

Tool output is capped at 6,000 characters and marked when truncated, so a large registry
or research payload cannot flood the context window. Change it with
`langchain_stackresolve.tools.MAX_CHARS`.

## Also available

- Hosted MCP server (no install): `https://mcp.stackresolve.dev/mcp`
- TypeScript SDK and CLI: `npm install stackresolve`
- Python SDK on its own: `pip install stackresolve`
- REST API: `https://api.stackresolve.dev`, OpenAPI at `/openapi.json`

## License

MIT
