Skip to main content

Generation and validation of Claude-compatible tools from OpenAPI specifications

Project description

OpenAPI Agent Tools

A library for generating and validating Claude-compatible tools from OpenAPI specifications.

Installation

pip install openapi-agent-tools

Or directly from the repository:

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

Usage

As a library

from openapi_agent_tools import (
    load_openapi_from_url, 
    generate_tools_from_openapi,
    validate_and_fix_tools
)

# Load an OpenAPI specification from a URL
openapi_spec = load_openapi_from_url("http://localhost:9999/doc")

# Generate tools from the specification
tools = generate_tools_from_openapi(openapi_spec, base_url="http://localhost:9999")

# 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")

Command Line Interface

Generate tools from an OpenAPI specification

# From a file
openapi-agent-tools generate --file path/to/openapi.json --output tools.json

# From a URL with validation
openapi-agent-tools generate --url https://docs.mistral.ai/redocusaurus/plugin-redoc-0.yaml  --validate --output tools.json

Validate and fix existing tools

openapi-agent-tools validate path/to/tools.json --output fixed_tools.json

Features

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

License

MIT

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

openapi_agent_tools-0.1.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

openapi_agent_tools-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openapi_agent_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for openapi_agent_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ce6b9268fa331371028cf512e2ad9e4c5723af9f641ac788496193156516e0cc
MD5 52fbab5442ebf37d2f46d26fb7314350
BLAKE2b-256 6022499a9e1860c777827178d2db375f521fe98bcd137c5e30c4bee74cad5f06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openapi_agent_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5459a91330f7719fe17a4e878a17b50dbde7b369bdd581536a261e4f3ab24f4
MD5 28397e6328f531d1e360310e159c871c
BLAKE2b-256 2235fb6865be37e1338974466e00dcf7918729b4a2252b4402bccbb351b0e0ab

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