coloph-toolset
Declare Python tools once. Export their JSON Schema and validate arguments before your application calls the function.
Version 0.2 adds catalogs, deferred command groups, exact selections, and generated CLIs.
The application owns execution, transactions, authorization, and model providers.
The roadmap describes later adapters. The package remains on 0.x while its interfaces settle.
Install
uv add coloph-toolset
The package requires Python 3.11 or later and Pydantic 2.12 or later within major version 2. No Coloph installation, database, credentials, HTTP framework, or agent framework is required.
Declare and validate
from typing import Annotated
from pydantic import Field, ValidationError
from coloph_toolset import tool, tool_for
@tool()
def shipping_quote(
ctx,
quantity: Annotated[int, "Number of parcels", Field(gt=0)],
destination: Annotated[str | None, "Country code, or null for collection"],
insured: Annotated[bool, "Include insurance"] = False,
) -> dict[str, object]:
return {"quantity": quantity, "destination": destination, "insured": insured}
declaration = tool_for(shipping_quote)
schema = declaration.json_schema()
arguments = declaration.validate_arguments({"quantity": "2", "destination": None})
result = shipping_quote(None, **arguments)
try:
declaration.validate_arguments({"quantity": 0, "destination": None})
except ValidationError as error:
print(error.errors(include_url=False))
Validation never calls the function. Calling the Python function directly does not apply validation. The application owns execution and must use validated arguments at its dispatch boundary.
Context and restricted arguments
The declaration expects a required first parameter named ctx.
Its type is application-owned and its annotation is not evaluated. Context never appears in the argument schema.
@tool(model_hidden_args=("internal",))
def inspect_order(ctx, order: str, internal: bool = False):
return ctx.lookup(order, internal=internal)
public = tool_for(inspect_order)
public.validate_arguments({"order": "demo"})
# An external "internal" argument raises ValidationError.
operator_schema = public.json_schema(include_hidden=True)
Hidden arguments require valid defaults. Only trusted application code can select include_hidden=True.
Argument projection is not an authorization system.
Contracts and examples
- Argument contract and API
- Catalog and CLI contract
- Standalone shipping-quote project
- Standalone task CLI
- Development and release procedure
- Changes
Every milestone adds a project under examples/. CI runs all preserved examples against the current library.
Development
uv sync --locked
uv run pytest
uv run mypy
uv run python -m ruff check .
uv run python -m ruff format --check .
uv build
uv run python scripts/smoke_wheel.py
MIT licensed.
Release files for coloph-toolset 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| coloph_toolset-0.2.3.tar.gz | 68.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coloph_toolset-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:91.6 kB
Release files / coloph_toolset-0.2.3.tar.gz
| Download URL | coloph_toolset-0.2.3.tar.gz |
|---|---|
| Size | 68.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99b54b77f22a83c86a8f285324f0c6d9aba0240b8b3a2aacf4dc2f1da31d4d6e
|
|
BLAKE2b-256 checksum How to use checksums |
be3d86cc11c41d225f8bacadd3dc4932e1b0b532376691549629aa724e4b2712
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / coloph_toolset-0.2.3-py3-none-any.whl
| Download URL | coloph_toolset-0.2.3-py3-none-any.whl |
|---|---|
| Size | 23.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f15497bfc4256a395f04d8d9bdde7e17ba17962ba75daa0299ed8e2035d0f7b7
|
|
BLAKE2b-256 checksum How to use checksums |
909ce59db6d37acf2eff74a1222f747bf0b6b530731759b27bf2cb2c50134607
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency log