tools.d: add boltzmann stash tool (fleet-memory CLI wrapper)
Wraps incus exec memory -- docker exec stash-stash-1 /stash <command> behind one MCP tool so pi-agents call stash command:="recall ... -n /infra/hosts" instead of hand-typing the incus/docker chain. Loaded via LMCP_TOOLS_DIR=/opt/lmcp/tools.d. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EWpfhDgYNA21tETDP9ueBE
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
-- boltzmann-tools plugin: `stash` — fleet persistent-memory CLI wrapper.
|
||||
-- Receives (server, run). Runs the stash CLI inside the memory Incus container's
|
||||
-- stash-stash-1 docker container (which has NO shell — /stash is invoked directly
|
||||
-- as argv; docker exec handles that, no `sh -c` inside the container).
|
||||
local server, run = ...
|
||||
|
||||
server:tool("stash",
|
||||
"Fleet persistent memory (stash knowledge graph on the memory container). "
|
||||
.. "`command` = a stash subcommand + its args as ONE string. "
|
||||
.. "Examples: command:=\"recall escher plug AIN\" | command:=\"facts\" | "
|
||||
.. "command:=\"remember 'the NAS is at 192.168.88.10'\" | command:=\"namespace list\". "
|
||||
.. "Wrap multi-word text in single quotes. Read subcommands: recall, facts, namespace list, "
|
||||
.. "goal list, context show. Write: remember, forget, consolidate run.",
|
||||
{ type = "object", properties = {
|
||||
command = { type = "string",
|
||||
description = "stash subcommand + args, e.g. \"recall <query>\" or \"remember '<text>'\"" },
|
||||
}, required = { "command" } },
|
||||
function(a)
|
||||
local c = tostring(a.command or ""):gsub("^%s+", ""):gsub("%s+$", "")
|
||||
if c == "" then return "Error: command required (e.g. command:=\"recall <query>\")" end
|
||||
return run("incus exec memory -- docker exec stash-stash-1 /stash " .. c, 60)
|
||||
end,
|
||||
{ annotations = {
|
||||
title = "Stash fleet memory",
|
||||
readOnlyHint = false,
|
||||
destructiveHint = false,
|
||||
idempotentHint = false,
|
||||
openWorldHint = true,
|
||||
} }
|
||||
)
|
||||
Reference in New Issue
Block a user