Explicit, async-first tool framework for LLM agents.
uv add yuutoolsimport yuutools as yt
def get_z(ctx) -> int:
return ctx.multiplier
@yt.tool(
params={"x": "first operand", "y": "list of ints to sum"},
name="goodtool",
description="Add x + sum(y) + z",
)
async def goodtool(x: int, y: list[int], z: int = yt.depends(get_z)):
return x + sum(y) + z
# Registry
manager = yt.ToolManager([goodtool])
tool = manager["goodtool"]
print(tool.spec.to("json_schema"))
# Bind context and run
result = await tool.bind(ctx).run(x=1, y=[2, 3])Decorator that turns a function into a Tool. Parameters:
params—{name: description}mapping for the LLM schemaname— override tool name (default:__name__)description— tool description (default: first docstring line)
Marks a parameter as context-injected. The resolver is called with the bound context at execution time. Hidden from the generated spec.
Serialize to "json_schema" or "yaml" (requires yuutools[yaml]).
Name-keyed registry with [] lookup, iteration, and .specs() for
bulk JSON schema export.
MIT