#!/usr/bin/env python3 # A tools bundle in Python: one tool of its own and one seat verb, served over stdio. import os import sys sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from mesh_sdk import Tool, serve # noqa: E402 serve("python-example", [ Tool("greet", "say hello", lambda a: {"greeting": f"hello {a.get('who', 'world')}", "language": "python"}, {"who": {"type": "string", "description": "whom"}}), Tool("node-lamp.on", "the seat's verb", lambda a: {"on": True, "language": "python"}), ])