1. Dispatch tool calls
hard50 XPImplement class ToolRegistry with register(name, model, fn) (model = Pydantic input model) and run(tool_uses) -> list[dict]. For each {"type": "tool_use", "id", "name", "input"} return {"type": "tool_result", "tool_use_id": id, "content": str(result)}. Unknown tool, validation failure, or an exception in fn → same shape with "is_error": True and a short error message as content. Results keep input order. Also implement schemas() returning [{"name", "input_schema"}] from model.model_json_schema().
Ctrl/⌘ + Enter runs the tests · Esc then Tab leaves the editor