Skip to main content

OpenAPI Agent Tools

A library for generating and validating Claude-compatible tools from OpenAPI specifications. I haven't tested it with other models but it should work too as tools are usually defined as JSON Schema

Installation

pip install openapi-agent-tools

Or directly from the repository:

pip install git+https://github.com/teobaldo33/openapi-agent-tools.git

Usage

from openapi_agent_tools import (
    generate_tools_from_openapi,
    validate_and_fix_tools
)

# Generate tools from the specification as json or yaml
tools = generate_tools_from_openapi(openapi_spec, base_url)

# Validate and fix tools for Claude compatibility
fixed_tools, failed_tools = validate_and_fix_tools(tools)

print(f"Generated and fixed {len(fixed_tools)} tools")

Features

  • OpenAPI Analysis: Process OpenAPI specifications to generate Agent-compatible tools
  • Schema Validation: Check and fix common errors in tool definitions
  • Claude Compatibility: Adapt schemas to be usable with AI Agents
  • CLI Interface: Command line utilities for use in scripts

License

MIT

Metadata

Release files for openapi-agent-tools 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openapi-agent-tools 0.2.0
File Size Uploaded
openapi_agent_tools-0.2.0.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openapi-agent-tools 0.2.0
File Interpreter ABI Platform
openapi_agent_tools-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / openapi_agent_tools-0.2.0.tar.gz

Download URL openapi_agent_tools-0.2.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
252ec779015c901c6199f8611d25999633c0400ab180118e01af1b0beddd303b
BLAKE2b-256 checksum
How to use checksums
1b8f12aa006f0ddfc349ac7f71fdeea6a5e0b980ee4705476e91b3a67d732149
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / openapi_agent_tools-0.2.0-py3-none-any.whl

Download URL openapi_agent_tools-0.2.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e3e2c347381bdab70b815e58aef02dd62c37bb5def0ee38f61f35ef886d8b9c
BLAKE2b-256 checksum
How to use checksums
0669b4a3e411978f4fde82fc35735ae1df47e0c00edc108375879010c1e2f722
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page