Metadata-Version: 2.5
Name: tool-boundary-py
Version: 0.1.1
Summary: Find changes to AI tool arguments, results, and errors at framework boundaries
Project-URL: Homepage, https://github.com/eduard-s/tool-boundary
Project-URL: Repository, https://github.com/eduard-s/tool-boundary
Project-URL: Issues, https://github.com/eduard-s/tool-boundary/issues
Author: Eduard S
License-Expression: MIT
License-File: LICENSE
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: pydantic<3,>=2.11
Provides-Extra: dev
Requires-Dist: build>=1; extra == 'dev'
Requires-Dist: mcp==1.26.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=1; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.14; extra == 'dev'
Provides-Extra: mcp-v1
Requires-Dist: mcp<2,>=1.26; extra == 'mcp-v1'
Description-Content-Type: text/markdown

# ToolBoundary for Python

ToolBoundary examines tool calls in MCP Python SDK v1. It compares the direct parser result with the arguments that a registered stub handler receives. It compares the results and errors that the client receives with explicit expectations.

## Install

Install the MCP adapter with `pip install 'tool-boundary-py[mcp-v1]'`.

## Example

[`examples/error_case.py`](examples/error_case.py) sends an explicit tool error through MCP Python SDK v1. It prints the report. On affected versions, it shows the difference at `/text`.

```sh
python examples/error_case.py
```

Use `probe_mcp_tool` in a pytest case. Set `reference` to a Pydantic model or another explicit parser. Pass a stub handler to `register`. Set `expected_structured` or `expected_error_text` to examine the response.

The adapter uses an in-memory MCP client session. It examines the client result from SDK dispatch. It does not examine HTTP or stdio transport behavior.

## Development

In this directory, make a virtual environment. Install the package with `pip install -e '.[dev]'`. Run `pytest` and `ruff check .`.

The adapter uses the official MCP server dispatch path. The caller registers a test handler through the same function as the application tool. Do not give the probe a production handler.

The [project README](https://github.com/eduard-s/tool-boundary#readme) describes the report format and defect cases.
