summaryrefslogtreecommitdiff
path: root/examples/extensions/echo.lua
diff options
context:
space:
mode:
Diffstat (limited to 'examples/extensions/echo.lua')
-rw-r--r--examples/extensions/echo.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/extensions/echo.lua b/examples/extensions/echo.lua
index 2f2d4de..112ee25 100644
--- a/examples/extensions/echo.lua
+++ b/examples/extensions/echo.lua
@@ -1,9 +1,11 @@
-- A trivial Lua tool that echoes back whatever the LLM asks it to.
-- Useful for exercising the panto CLI's Lua extension path end-to-end.
+--
+-- Single-tool sugar form: return a table with a `handler` and panto
+-- registers it as a tool. Its `name` is the identity gated by the
+-- `[extensions]` allow/deny policy.
-local panto = require("panto")
-
-panto.ext.register_tool {
+return {
name = "echo",
description = "Echo back the given message. Useful for testing whether tools work.",
schema = {