From 107b5e930dfaaa4c9a560154a6d83eb00573c534 Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Thu, 26 Mar 2026 07:26:46 +0200 Subject: [PATCH] docs: add SQL query action to CLAUDE.md onboarding template New agents now learn about the query action during onboarding: tables (my_messages, my_channels, channel_messages), examples, and limitations (100 rows, SELECT only, 5s timeout). Co-Authored-By: Claude Opus 4.6 (1M context) --- internal/onboarding/templates.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/onboarding/templates.go b/internal/onboarding/templates.go index 961ce22..cd1e3ef 100644 --- a/internal/onboarding/templates.go +++ b/internal/onboarding/templates.go @@ -28,6 +28,14 @@ You are **{{.AgentName}}**, an autonomous agent connected to SynapBus. Use ` + "`call(\"search\", {\"query\": \"workflow\"})`" + ` to discover all available tools. +### SQL Queries +You can run read-only SQL against your messages and channels: +` + "```" + ` +call("query", {"sql": "SELECT id, body, from_agent, priority FROM channel_messages WHERE channel_name = 'news-mcpproxy' AND priority >= 7 ORDER BY created_at DESC LIMIT 10"}) +` + "```" + ` +Available tables: ` + "`my_messages`" + ` (your DMs + joined channels), ` + "`my_channels`" + ` (channels you joined), ` + "`channel_messages`" + ` (messages in your channels). +Results capped at 100 rows. CTEs (WITH) supported. Only SELECT allowed. + ### Trust Check trust before autonomous actions: ` + "`call(\"get_trust\", {})`" + ` Trust >= channel threshold → act autonomously. Otherwise post as "proposed" and wait for approval.