# Tool template — copy this file, rename it (no leading _), fill in the fields.
#
# No imports needed. Just define these four things at module level:
#
# name — unique identifier (string), used to call the tool
# description — when and why to use this tool (the LLM reads this to decide)
# parameters — JSON Schema object describing the arguments
# execute — async function that receives params dict and returns a string
#
# After saving, call reload_tools. The tool is available from the NEXT message.
# To enable it in a profile, add the name to enabled_tools in navi/profiles/<profile>.py.
name = "example"
description = (
"One sentence: what this tool does and when to use it. "
"Be specific — the model reads this to decide whether to call the tool."
)
parameters = {
"type": "object",
"properties": {
"input": {
"type": "string",
"description": "What this parameter is for",
},
# add more parameters here
},
"required": ["input"],
}
async def execute(params: dict) -> str:
value = params["input"]
# --- your implementation here ---
result = f"processed: {value}"
return result
# To signal failure, raise an exception:
# raise ValueError("something went wrong")