Skip to main content

OpenAPI-style breaking-change detection for LLM tool contracts.

Project description

ToolProbe

OpenAPI-style breaking-change detection for LLM tools.

ToolProbe validates a committed toolprobe.yaml contract so tool schemas, trigger examples, mock responses, and recovery expectations do not silently drift as your agent changes.

Why

Agent failures often happen at the tool boundary:

  • the agent calls a tool whose schema changed
  • a required argument disappears or changes type
  • trigger examples no longer match declared arguments
  • mock responses drift away from the output schema
  • error recovery behavior gets removed during a refactor

ToolProbe treats tool definitions like API contracts and checks them in CI before runtime.

Install

pip install toolprobe

For local development:

pip install -e ".[dev]"

Contract Example

contract: v1

tools:
  - name: get_weather
    description: Get current weather for a city.
    args:
      city: string
      units:
        type: string
    required_args:
      - city
    forbidden_args:
      - country
    triggers:
      - "weather in {city}"
      - "what's it like in {city}"
    output_schema:
      type: object
      properties:
        temperature_c: number
        condition: string
      required:
        - temperature_c
        - condition
    mock_success:
      temperature_c: 32
      condition: sunny
    mock_errors:
      - name: timeout
        response:
          error: API timeout
        expected_recovery_contains: "couldn't fetch"

output_schema is a standard root object schema, so you can make only some top-level fields required:

output_schema:
  type: object
  properties:
    condition: string
    temperature_c: number
  required:
    - condition

Usage

Validate the current contract:

toolprobe lint toolprobe.yaml

Compare the current contract against a git ref:

toolprobe diff HEAD~1 toolprobe.yaml

Example output:

ToolProbe diff against HEAD~1
============================
WARN removed-required-arg tools.search_flights.required_args: argument 'date' is no longer required
ERROR arg-type-changed tools.search_flights.args.date: argument 'date' changed type
ERROR removed-trigger tools.search_flights.triggers: trigger was removed: 'flights to {destination} on {date}'

Summary: 2 error(s), 1 warning(s)

Checks

toolprobe lint currently checks:

  • duplicate tool names
  • missing or invalid argument schemas
  • required args not declared in args
  • overlap between required and forbidden args
  • trigger placeholders that reference unknown args
  • invalid output schemas
  • mock success responses that do not match the output schema
  • missing recovery expectations for mock tool errors

toolprobe diff currently flags:

  • removed tools
  • removed arguments
  • newly required arguments
  • removed required arguments
  • changed argument types
  • removed trigger examples
  • removed output properties
  • changed output field types
  • removed recovery expectations
  • changed recovery expectations

CI

name: toolprobe

on: [pull_request]

jobs:
  contracts:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pip install toolprobe
      - run: toolprobe lint toolprobe.yaml
      - run: toolprobe diff origin/main toolprobe.yaml

Development

pip install -e ".[dev]"
pytest

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

toolprobe-0.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

toolprobe-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for toolprobe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1cbb7d6da0174ee8c1c89818f7d2c57ff3e740c23dceaa775b2d242c79850150
MD5 177eb38a449abf2af7056213a47c2619
BLAKE2b-256 9d75b0296a537ea17e0f21162ef8d0060a915532032eb5529f6d971305700407

See more details on using hashes here.

File details

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

File metadata

  • Download URL: toolprobe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for toolprobe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3837c8899f12773f577ee51323ac437bd17530fbf142897f928b15e1cdc29f9a
MD5 0fa87aceccf0f08addde6b1ffc041d10
BLAKE2b-256 6ff3f725b688c4adf0c0f034acfcea520d258d70ae71561fe2aef34dfda7021b

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