@slack/radar-mcp 1.22.0 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -12
- package/dist/mcp/dashboard-identity.d.ts +10 -0
- package/dist/mcp/dashboard-identity.js +20 -0
- package/dist/mcp/debug-package-reset.d.ts +5 -0
- package/dist/mcp/debug-package-reset.js +28 -0
- package/dist/mcp/flags-tools.d.ts +2 -0
- package/dist/mcp/flags-tools.js +15 -1
- package/dist/mcp/index.js +172 -142
- package/dist/mcp/radar-http.d.ts +22 -0
- package/dist/mcp/radar-http.js +63 -0
- package/dist/mcp/radar-response.d.ts +1 -0
- package/dist/mcp/session-enable.d.ts +15 -0
- package/dist/mcp/session-enable.js +195 -33
- package/dist/mcp/sources-gate.js +5 -0
- package/dist/mcp/switchboard-tools.d.ts +5 -2
- package/dist/mcp/switchboard-tools.js +18 -12
- package/dist/mcp/test-cases.d.ts +14 -0
- package/dist/mcp/test-cases.js +77 -0
- package/dist/mcp/test-runs-tools.d.ts +8 -0
- package/dist/mcp/test-runs-tools.js +95 -0
- package/dist/mcp/tools.js +106 -171
- package/dist/mcp/web-child-env.js +2 -1
- package/dist/shared/android.d.ts +75 -10
- package/dist/shared/android.js +352 -109
- package/dist/shared/constants.d.ts +17 -5
- package/dist/shared/constants.js +59 -5
- package/dist/shared/db.d.ts +1 -1
- package/dist/shared/db.js +21 -14
- package/dist/shared/debug-log.js +2 -4
- package/dist/shared/enable-diagnosis.d.ts +27 -1
- package/dist/shared/enable-diagnosis.js +73 -0
- package/dist/shared/log-session.d.ts +2 -1
- package/dist/shared/logcat-capture.js +17 -1
- package/dist/shared/prefs.js +4 -5
- package/dist/shared/radar-request-raw.js +3 -1
- package/dist/shared/switchboard.d.ts +1 -0
- package/dist/shared/switchboard.js +3 -1
- package/dist/shared/transport.d.ts +30 -0
- package/dist/web/install-app.d.ts +18 -0
- package/dist/web/install-app.js +60 -7
- package/dist/web/macapp/RadarApp.swift +147 -1
- package/dist/web/server.d.ts +17 -0
- package/dist/web/server.js +180 -35
- package/package.json +1 -1
package/dist/mcp/tools.js
CHANGED
|
@@ -5,143 +5,38 @@ export const SERVER_INSTRUCTIONS = [
|
|
|
5
5
|
"",
|
|
6
6
|
"SESSION STATE:",
|
|
7
7
|
"Radar starts DISABLED each session. ping, list_profiles, and open_radar_dashboard work before enabling; other tools return an error until enabled.",
|
|
8
|
-
"export_switchboard_session also works after an auto-disable if this process streamed the call",
|
|
9
|
-
"live. It builds the report from the live stream copy, no device call needed.",
|
|
10
8
|
"Use /radar-enable to activate, /radar-disable to deactivate.",
|
|
11
9
|
"",
|
|
12
|
-
"AUTO-ENABLE: When the user asks an obvious device question,
|
|
13
|
-
'skill="radar-enable"
|
|
10
|
+
"AUTO-ENABLE: When the user asks an obvious device question, call the radar tool straight away.",
|
|
11
|
+
'Invoke the Skill tool with skill="radar-enable" only when a tool says Radar is not active or',
|
|
12
|
+
"Session disabled, or when the user asks to connect.",
|
|
14
13
|
"Obvious device questions include: clogs, network calls, RTM events, screenshots,",
|
|
15
14
|
"app state, device logs, Slackbot voice sessions, or any reference to what is happening on the connected device.",
|
|
15
|
+
"Enable once without asking, then retry the tool. If the enable or the retry fails, tell the user and stop.",
|
|
16
16
|
"",
|
|
17
17
|
"TIMEOUT: The device-side radar auto-shuts down after idle. On tool call failure,",
|
|
18
|
-
"the session flips to disabled
|
|
18
|
+
"the session flips to disabled and the tool says Radar is not active or Session disabled. The AUTO-ENABLE rule applies.",
|
|
19
|
+
"ping(timeout_minutes=N) extends a session; watch remaining_minutes.",
|
|
19
20
|
"",
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
'- "watch what happens when I..." -> clear_buffers then wait_for_events (DO NOT filter unless the user specifies a type)',
|
|
25
|
-
'- "did that clog fire" / "check analytics" -> get_recent_clogs(name="...")',
|
|
26
|
-
'- "why is this slow" / "how long did X take" / "show me the traces" / "check performance" -> get_recent_traces(name="...") then get_trace_detail',
|
|
27
|
-
'- "what API call was that" -> get_recent_network_calls then get_network_call_detail',
|
|
28
|
-
'- "did I get X" / "did X happen" -> search(query="X") across ALL buffers, not just one',
|
|
29
|
-
'- "everything since I enabled" / "the whole session" / "what did I miss" -> query_session',
|
|
30
|
-
'- "what happened in the voice session" / "why did playback stutter" / "did the mic open" -> get_switchboard_sessions then get_switchboard_session(id, kind=...): player for stutter, state for mic and connection, phase for slow start',
|
|
31
|
-
'- "did the turns get saved" / "why is a turn missing from the DM" -> get_switchboard_session(id, kind=saved_turn): outcome is applied, no_line (no subtitle line still held the item, still kept), or why a turn was dropped; the summary\'s saved_turn_counts counts each outcome (absent on an older device build means not counted, not zero). A server resend counts again under applied or no_line, so their sum can run above the finals and is not a lost turn. Every turn other_session with a null server_session_id usually means session.ready named no session (a ready record with a null id) or never arrived (no ready record).',
|
|
32
|
-
'- "export this voice session" / "save the switchboard session" / "hand this voice session to someone else" -> export_switchboard_session(id=...)',
|
|
33
|
-
'- "check the debug logs" -> get_recent_logs (tag is OPTIONAL: pass tag="SlackRadar" to filter, or omit it for all recent lines)',
|
|
34
|
-
'- "is flag X on?" / "what is the effective value of X" / "what feature flags does the app have" -> get_feature_flag(key="X") / search_feature_flags(query="X") / list_feature_flags. This is the LIVE effective state (override if set, else server value), requires a debug build with the feature-flag Radar plugin.',
|
|
35
|
-
'- "what feature-flag overrides are set?" / "check debug_features" -> search_prefs(query="X") or get_prefs(file="debug_features_...xml"). This shows MANUAL OVERRIDES only, not effective flag state: debug_features_*.xml holds only flags the debug menu overrode, and an override is deleted once it matches the server value. A flag missing from this file can still be ON server-side -- absence means "no override," never "disabled." Prefer get_feature_flag/list_feature_flags/search_feature_flags for the actual live value; use this route only when the manual-override history itself is what is being asked about.',
|
|
36
|
-
'- "what did the app remember" / "what is cached in prefs" / "what team_prefs are set" -> list_prefs then get_prefs',
|
|
37
|
-
'- "save this" / "file this as a bug" / "share this" / "bundle this" / "attach to ticket" / "give me a repro" / "snapshot this" / "preserve this" / "hold this state" / "save what you just saw" -> capture_snapshot',
|
|
21
|
+
"Routes: screen -> screenshot; what just happened -> get_recent_network_calls + get_recent_rtm_events; slow -> get_recent_traces;",
|
|
22
|
+
"clog fired -> get_recent_clogs; did X happen -> search; whole session -> query_session; watch -> clear_buffers + wait_for_events;",
|
|
23
|
+
"flag on -> get_feature_flag; prefs -> list_prefs; bug or share -> capture_snapshot; replay or stress RTM -> run_test_case; logs -> get_recent_logs;",
|
|
24
|
+
"voice session -> get_switchboard_sessions, get_switchboard_session (kind=saved_turn for saved or missing turns), export_switchboard_session.",
|
|
38
25
|
"",
|
|
39
|
-
"
|
|
26
|
+
"Habits:",
|
|
40
27
|
"- Network/RTM buffers clear on shutdown. Clogs persist from app start.",
|
|
41
28
|
"- If ping fails, do NOT retry. Tell the user and fall back to code-only analysis.",
|
|
42
29
|
"- Fetch details eagerly. When results reveal interesting events, get their detail immediately.",
|
|
43
|
-
"-
|
|
44
|
-
"-
|
|
45
|
-
"
|
|
46
|
-
"-
|
|
47
|
-
" build can run on more than one user (personal=0, plus a work profile or secondary user),",
|
|
48
|
-
" and only the first to bind the socket wins. If events seem to come from the wrong app, tell",
|
|
49
|
-
" the user which profile is bound and use list_profiles + activate_for_user to switch.",
|
|
50
|
-
"- MULTIPLE DEVICES: with more than one device attached, enable fails and returns the list of",
|
|
51
|
-
" attached serials. Retry _radar_session_enable with device_serial set to one of them. When the",
|
|
52
|
-
" intent is unclear (you cannot tell which device the user means), ask which device before retrying;",
|
|
53
|
-
" do not guess. The enable success response names the bound device via device_label, so confirm it",
|
|
54
|
-
" matches what the user expected. The picked device applies to every tool for the whole session. Do",
|
|
55
|
-
" not confuse this with profiles: profiles are separate users on ONE device (personal vs work), while",
|
|
56
|
-
" devices are separate hardware.",
|
|
57
|
-
"- Screenshots default to 720px. Use full_res=true only when detail matters.",
|
|
30
|
+
"- To watch a flow, clear_buffers then wait_for_events with no filter unless the user names a type; use idle_timeout_ms, not polling.",
|
|
31
|
+
"- Flag values: get_feature_flag / search_feature_flags / list_feature_flags. debug_features_*.xml (get_prefs / search_prefs) holds",
|
|
32
|
+
" manual overrides only; a flag missing there means no override, never off.",
|
|
33
|
+
"- Live screen mirroring needs ffmpeg: give the user the install command, never run it.",
|
|
58
34
|
"- Setup: /slack-radar-setup",
|
|
59
|
-
"- Manual enable (no skill): adb shell am broadcast -a slack.debug.ENABLE_RADAR --ei timeout_minutes 5 -p com.Slack.internal.debug",
|
|
60
|
-
" Then: adb forward tcp:8099 localabstract:slack-radar (prefix adb -s <serial> when multiple devices are attached)",
|
|
61
|
-
" This starts Radar in open mode (no radar_token extra, so the device accepts any caller). Use it only when /radar-enable cannot run; /radar-enable sends the token.",
|
|
62
35
|
"",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"plus the Database/Preferences/Feature Flags browsers.",
|
|
68
|
-
"Launched via the /radar-ui skill, which runs",
|
|
69
|
-
"`npx @slack/radar-mcp web` (a global install also exposes it as `slack-radar`).",
|
|
70
|
-
"",
|
|
71
|
-
"PROACTIVELY offer the dashboard when it would help — do not wait to be asked. The moment a",
|
|
72
|
-
"device session turns visual or multi-step, say so and offer to open it, e.g.: \"This is",
|
|
73
|
-
"easier to watch live — want me to open the Radar dashboard?\" Offer (once per thread) when:",
|
|
74
|
-
'- User says "watch", "monitor", "let me see", "show me live" about device traffic',
|
|
75
|
-
"- User wants to share traffic with a colleague, pair, or teammate",
|
|
76
|
-
"- User is doing a multi-minute investigation and the transcript is getting noisy",
|
|
77
|
-
'- User explicitly asks about a GUI, UI, browser view, or dashboard',
|
|
78
|
-
"",
|
|
79
|
-
"OFFER, then open ONLY AFTER THE USER AGREES — opening a browser window is a user-visible",
|
|
80
|
-
"action; never pop one unbidden. On a yes, run the /radar-ui skill (or tell them to run",
|
|
81
|
-
"`npx @slack/radar-mcp web`) and hand over the URL. Nudge, do not auto-open.",
|
|
82
|
-
"DO NOT offer for single-query debugging or when the user is happy reading results in the",
|
|
83
|
-
"transcript. Offer when visual inspection adds real value.",
|
|
84
|
-
"",
|
|
85
|
-
"SCREEN OVERLAY (in the dashboard):",
|
|
86
|
-
"The dashboard has a '▣ Screen' button that mirrors the LIVE device screen in a side panel,",
|
|
87
|
-
"plus a full-resolution screenshot and screen recording. It is OFF by default and opens to a",
|
|
88
|
-
"consent notice first, because it shows real on-screen content (open DMs, messages). The live",
|
|
89
|
-
"mirror needs ffmpeg on the user's machine; the screenshot does not. If the user wants the live",
|
|
90
|
-
"screen and ffmpeg is missing, tell them plainly that live mirroring needs ffmpeg and give the",
|
|
91
|
-
"platform install command (mac: `brew install ffmpeg`; debian/ubuntu: `sudo apt install ffmpeg`;",
|
|
92
|
-
"windows: `winget install ffmpeg`), and note the screenshot works without it. NEVER run the",
|
|
93
|
-
"install for them. The dashboard's /health response reports screen.ffmpeg / screen.liveCast /",
|
|
94
|
-
"screen.installHint, so you can check before suggesting.",
|
|
95
|
-
"",
|
|
96
|
-
"CUSTOM DASHBOARD (open_radar_dashboard):",
|
|
97
|
-
"The pre-built tabs (Live/Network/RTM/Clogs/Traces/Logs/Switchboard, plus the Database/Preferences/Feature Flags",
|
|
98
|
-
"browsers) cover the common cases. When the user",
|
|
99
|
-
"describes a live view the tabs do not show, SUGGEST building it; invoke open_radar_dashboard",
|
|
100
|
-
"only after they agree or explicitly ask for a custom view/dashboard (same discipline as",
|
|
101
|
-
"/radar-ui). To build, translate their words into a spec and call the tool; it renders your",
|
|
102
|
-
"spec as a 'Custom' tab on the dashboard (default http://localhost:8100) and returns the URL",
|
|
103
|
-
"for you to share. Cases worth suggesting it for:",
|
|
104
|
-
'- "graph calls per second vs average response time and flag the slow ones"',
|
|
105
|
-
'- "count every DM I receive and beep when one arrives"',
|
|
106
|
-
'- "show only RTM events on channel C... and let me click each for its payload"',
|
|
107
|
-
'- "watch network calls whose body contains <substring>"',
|
|
108
|
-
'- "show me only the <Tag> logs, DEBUG and up, without the noisy lines": a constrained log view,',
|
|
109
|
-
" e.g. {source: \"log\", match: {package: \"com.Slack.internal.debug\", tag: \"<Tag>\"}, minLevel: \"DEBUG\",",
|
|
110
|
-
" exclude: [\"noisy term\"]}. It lands as a Custom tab, gone on a page refresh unless pushed again;",
|
|
111
|
-
" exclude terms are remembered in the browser only on the pre-built tabs, not on Custom. One",
|
|
112
|
-
" phrase per exclude term, no commas or line breaks.",
|
|
113
|
-
"Authoring rules:",
|
|
114
|
-
"- source is one of network/rtm/clog/trace/log/switchboard/all ('all' = one unified timeline).",
|
|
115
|
-
"- match filters on SUMMARY fields only, by source: network=url/method/status_code,",
|
|
116
|
-
" rtm=event_type/direction/channel, clog=event_name, trace=trace_name/span_name,",
|
|
117
|
-
" log=tag/level/message/pid/package (iOS also: subsystem/process),",
|
|
118
|
-
" switchboard=kind/session_id/direction/frame_type/state_kind/phase/event/clock/outcome.",
|
|
119
|
-
" NEVER invent a field; a match on a field the stream does not carry silently matches",
|
|
120
|
-
" nothing. To filter on body text use bodyContains (network/all only), which fetches detail.",
|
|
121
|
-
"- viz composes counter/rate/sparkline/feed/inspector/graph/voice. graph needs a series array",
|
|
122
|
-
" (1-2 entries; metric ratePerSec/count/avg/errorRate; avg needs a field like duration_ms).",
|
|
123
|
-
" voice is the Switchboard tab's session panel and draws only for source switchboard.",
|
|
124
|
-
"- highlight {field, op, value} flags rows breaching a numeric threshold; alert {sound,flash,",
|
|
125
|
-
" say, at} fires on each live match (or once at the Nth). Author an honest one-line `summary`.",
|
|
126
|
-
"Calling it again replaces/refines the live custom dashboard. The dashboard reads a connected",
|
|
127
|
-
"device, so Radar must be armed to show data (it has its own Reconnect button). Debug builds",
|
|
128
|
-
"only; local only. Does not open a browser window for you; surface the returned URL to the user.",
|
|
129
|
-
"",
|
|
130
|
-
"CAPTURE_SNAPSHOT OUTPUT:",
|
|
131
|
-
"When capture_snapshot returns, tell the user:",
|
|
132
|
-
" 1. The result.zip_path if non-null (the single shareable file). Fall back to",
|
|
133
|
-
" result.path (a directory) if zip_path is null.",
|
|
134
|
-
" 2. A one-line summary of counts (network/rtm/clogs/traces/log_lines/screenshot).",
|
|
135
|
-
" 3. Print this EXACT sentence as the privacy line, verbatim — no paraphrase, no",
|
|
136
|
-
" compression, no skipping even under time pressure:",
|
|
137
|
-
' "Privacy: bundle.json contains raw API request/response bodies (including auth headers), RTM message content, user IDs, clog payloads, and performance trace spans. Review before sharing externally."',
|
|
138
|
-
" 4. If result.log_lines_truncated is true, say: 'you got fewer log lines than",
|
|
139
|
-
" requested because the 1 MB read cap was the limiting factor.'",
|
|
140
|
-
" 5. If the user's original ask was 'file this as a bug' / 'attach to ticket' /",
|
|
141
|
-
" similar, offer to attach result.zip_path via the Jira MCP or Slack MCP as",
|
|
142
|
-
" the next step. Do NOT invoke the attach without asking. Just offer.",
|
|
143
|
-
" 6. If result.errors is non-empty, enumerate which parts failed so the user",
|
|
144
|
-
" knows what is missing before they ship the bundle.",
|
|
36
|
+
"DASHBOARD: offer the /radar-ui browser dashboard (http://localhost:8100, or SLACK_RADAR_WEB_PORT) once per thread when a session turns visual, live or",
|
|
37
|
+
"multi-step, or the user wants to share or asks for a UI; not for single-query debugging. Open it ONLY AFTER THE USER AGREES, never",
|
|
38
|
+
"unbidden: run /radar-ui (or `npx @slack/radar-mcp web`) and hand over the URL.",
|
|
39
|
+
"open_radar_dashboard builds a custom tab under the same consent.",
|
|
145
40
|
].join("\n");
|
|
146
41
|
/**
|
|
147
42
|
* The instructions the model actually receives, for the platform this session resolved to.
|
|
@@ -158,17 +53,14 @@ export function serverInstructions(platform) {
|
|
|
158
53
|
return SERVER_INSTRUCTIONS;
|
|
159
54
|
if (platform === "ios") {
|
|
160
55
|
return [
|
|
161
|
-
"PLATFORM: iOS Simulator (NOT Android over adb).",
|
|
162
|
-
"
|
|
163
|
-
"-
|
|
164
|
-
"
|
|
165
|
-
"-
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
" activate_for_user. Treat their supported-platform error as a capability gap.",
|
|
170
|
-
"- Unified-log capture begins when the Radar session is enabled; it cannot backfill logs",
|
|
171
|
-
" emitted before that point. Leave tag unset for all Slack-authored categories.",
|
|
56
|
+
"PLATFORM: iOS Simulator (NOT Android over adb). Overrides Android advice below or in a tool description:",
|
|
57
|
+
"- Radar enables a booted Simulator's app listener directly; ignore adb, profiles and package names.",
|
|
58
|
+
"- Available: ping, network calls, RTM events, clogs, traces, search, query_session, wait_for_events,",
|
|
59
|
+
" clear_buffers, feature flags, capture_snapshot, get_recent_logs, screenshot, record_screen, open_radar_dashboard.",
|
|
60
|
+
"- Not available: get_app_state, database tools, preferences tools, list_profiles, activate_for_user;",
|
|
61
|
+
" treat their supported-platform error as a capability gap.",
|
|
62
|
+
"- Unified-log capture begins when the Radar session is enabled; it cannot backfill logs.",
|
|
63
|
+
" Leave tag unset for all Slack-authored categories.",
|
|
172
64
|
"- Physical iOS devices are not supported yet.",
|
|
173
65
|
"",
|
|
174
66
|
SERVER_INSTRUCTIONS,
|
|
@@ -177,32 +69,30 @@ export function serverInstructions(platform) {
|
|
|
177
69
|
if (platform === "webapp") {
|
|
178
70
|
return [
|
|
179
71
|
"PLATFORM: webapp (a local Slack webapp dev server, NOT an Android device over adb).",
|
|
180
|
-
"
|
|
181
|
-
"- There is no adb and no device.
|
|
182
|
-
"-
|
|
183
|
-
"
|
|
184
|
-
"-
|
|
185
|
-
"
|
|
186
|
-
" open_radar_dashboard. They return a clean 'not supported on platform webapp'.",
|
|
187
|
-
"- Available and behaving as documented below: ping, network calls, RTM events, clogs,",
|
|
188
|
-
" traces, search, query_session, wait_for_events, clear_buffers, capture_snapshot",
|
|
189
|
-
" (without a screenshot), and the feature-flag tools.",
|
|
72
|
+
"Overrides device advice below or in a tool description:",
|
|
73
|
+
"- There is no adb and no device. Radar is plain HTTP on localhost, so enable cannot fail for a device-arming reason.",
|
|
74
|
+
"- NOT available, do not call: screenshot, record_screen, get_app_state, get_recent_logs, the database tools,",
|
|
75
|
+
" the preferences tools, open_radar_dashboard. They return 'not supported on platform webapp'.",
|
|
76
|
+
"- Available: ping, network calls, RTM events, clogs, traces, search, query_session, wait_for_events,",
|
|
77
|
+
" clear_buffers, capture_snapshot (without a screenshot), feature-flag tools.",
|
|
190
78
|
"",
|
|
191
79
|
SERVER_INSTRUCTIONS,
|
|
192
80
|
].join("\n");
|
|
193
81
|
}
|
|
194
82
|
return [
|
|
195
|
-
`PLATFORM: ${platform}. Anything below that assumes an Android device over adb may not apply.`,
|
|
83
|
+
`PLATFORM: ${platform}. Anything below or in a tool description that assumes an Android device over adb may not apply.`,
|
|
196
84
|
"A tool with no implementation on this platform returns a clean 'not supported' error rather",
|
|
197
85
|
"than failing; treat that as a capability gap, not a fault to retry.",
|
|
198
86
|
"",
|
|
199
87
|
SERVER_INSTRUCTIONS,
|
|
200
88
|
].join("\n");
|
|
201
89
|
}
|
|
90
|
+
// Shared by the three flag tools so their wording cannot drift apart.
|
|
91
|
+
const SESSION_VALUE_NOTE = "Rows carry session_enabled (the flag's own value fixed for this session) and restart_note when it differs from `enabled`; a row where session_enabled or enabled is absent or not a boolean is not known, never a match; only when both are booleans does a missing restart_note mean they match.";
|
|
202
92
|
export const TOOL_DEFINITIONS = [
|
|
203
93
|
{
|
|
204
94
|
name: "ping",
|
|
205
|
-
description: "Check if Slack Radar is running. Returns uptime, buffer sizes, remaining session time, stream status, the Radar MCP tool version (mcp_version), and which app/profile is bound: android_user_id (0 = personal, non-zero = a secondary user such as a work profile), profile ('personal'/'secondary'), and package. If the result has a warning field, show it to the user verbatim.",
|
|
95
|
+
description: "Check if Slack Radar is running. Returns uptime, buffer sizes, remaining session time, stream status, the Radar MCP tool version (mcp_version), dashboard_url (the URL the Radar web dashboard uses for this server, from SLACK_RADAR_WEB_PORT with default 8100, not a check that the dashboard is up), and which app/profile is bound: android_user_id (0 = personal, non-zero = a secondary user such as a work profile), profile ('personal'/'secondary'), and package. If the result has a warning field, show it to the user verbatim. The debug build can run on more than one user and only the first to bind wins; if events look like the wrong app, say which profile is bound and use list_profiles + activate_for_user.",
|
|
206
96
|
inputSchema: {
|
|
207
97
|
type: "object",
|
|
208
98
|
properties: {
|
|
@@ -216,7 +106,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
216
106
|
},
|
|
217
107
|
{
|
|
218
108
|
name: "get_recent_network_calls",
|
|
219
|
-
description: "Get recent HTTP network calls captured from the Slack Android app.",
|
|
109
|
+
description: "Get recent HTTP network calls captured from the Slack Android app. Use when the user asks 'what just happened' / 'what's going on' (with get_recent_rtm_events), 'why isn't this loading' / 'this is broken' (with a screenshot, and status_code 400 or 500), or 'what API call was that' (then get_network_call_detail).",
|
|
220
110
|
inputSchema: {
|
|
221
111
|
type: "object",
|
|
222
112
|
properties: {
|
|
@@ -241,7 +131,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
241
131
|
},
|
|
242
132
|
{
|
|
243
133
|
name: "get_recent_rtm_events",
|
|
244
|
-
description: "Get recent RTM (Real Time Messaging) event summaries.",
|
|
134
|
+
description: "Get recent RTM (Real Time Messaging) event summaries. Use when the user asks 'what just happened' / 'what's going on' (with get_recent_network_calls). Event types use subtypes when there is one (message_changed, not message).",
|
|
245
135
|
inputSchema: {
|
|
246
136
|
type: "object",
|
|
247
137
|
properties: {
|
|
@@ -267,7 +157,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
267
157
|
},
|
|
268
158
|
{
|
|
269
159
|
name: "get_recent_clogs",
|
|
270
|
-
description: "Get recent clog (analytics) event summaries. Returns event name and timestamp. Use get_clog_detail for the full JSON payload.",
|
|
160
|
+
description: "Get recent clog (analytics) event summaries. Returns event name and timestamp. Use get_clog_detail for the full JSON payload. Use when the user asks 'did that clog fire' / 'check analytics'; pass name.",
|
|
271
161
|
inputSchema: {
|
|
272
162
|
type: "object",
|
|
273
163
|
properties: {
|
|
@@ -291,7 +181,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
291
181
|
},
|
|
292
182
|
{
|
|
293
183
|
name: "get_recent_traces",
|
|
294
|
-
description: "Get recent performance trace summaries (one row per completed span from the app's telemetry pipeline). Returns trace name, span name, and duration. Use get_trace_detail for the full span, including its tags and the parent/trace ids.",
|
|
184
|
+
description: "Get recent performance trace summaries (one row per completed span from the app's telemetry pipeline). Returns trace name, span name, and duration. Use get_trace_detail for the full span, including its tags and the parent/trace ids. Use when the user asks 'why is this slow' / 'how long did X take' / 'show me the traces' / 'check performance'; pass name.",
|
|
295
185
|
inputSchema: {
|
|
296
186
|
type: "object",
|
|
297
187
|
properties: {
|
|
@@ -315,11 +205,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
315
205
|
},
|
|
316
206
|
{
|
|
317
207
|
name: "wait_for_events",
|
|
318
|
-
description: "Wait for matching events to arrive in real-time via the SSE stream.",
|
|
208
|
+
description: "Wait for matching events to arrive in real-time via the SSE stream. Use when the user asks 'watch what happens when I...': clear_buffers first, then wait. Leave event_type and channel unset unless the user names one. Use idle_timeout_ms, never a polling loop.",
|
|
319
209
|
inputSchema: {
|
|
320
210
|
type: "object",
|
|
321
211
|
properties: {
|
|
322
|
-
event_type: { type: "string", description: "RTM event type to wait for" },
|
|
212
|
+
event_type: { type: "string", description: "RTM event type to wait for. The match is exact, so use the subtype when there is one (message_changed, not message)." },
|
|
323
213
|
channel: { type: "string", description: "Filter by channel ID" },
|
|
324
214
|
source: { type: "string", description: "Limit to one stream: network, rtm, clog, log, trace, or switchboard (default: all). During a Slackbot voice session switchboard emits several records a second, so an unscoped wait fills with them; scope to the source you want or shorten timeout_ms." },
|
|
325
215
|
timeout_ms: { type: "number", description: "Max time to wait in ms (default: 30000)" },
|
|
@@ -330,7 +220,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
330
220
|
},
|
|
331
221
|
{
|
|
332
222
|
name: "search",
|
|
333
|
-
description: "Search across all captured network calls, RTM events, clogs, and performance traces.",
|
|
223
|
+
description: "Search across all captured network calls, RTM events, clogs, and performance traces. Use when the user asks 'did I get X' / 'did X happen'; it searches every buffer, not just one.",
|
|
334
224
|
inputSchema: {
|
|
335
225
|
type: "object",
|
|
336
226
|
properties: {
|
|
@@ -343,13 +233,13 @@ export const TOOL_DEFINITIONS = [
|
|
|
343
233
|
},
|
|
344
234
|
{
|
|
345
235
|
name: "get_switchboard_sessions",
|
|
346
|
-
description: "List the Slackbot voice (switchboard) sessions the device still holds, at most 8, newest first. A session is one voice conversation attempt, from the controller starting (before any socket opens) to it ending. Each entry carries session_id, team_id, began_at, ended_at (null live), total_captured, frames {incoming, outgoing}, last_state (newest connection/mic/speaking state, absent before the first state record), levels (newest level tick, or null), server_session_id (null until named), turns ({count, last_response_ms, last_clock}, null before the first timed turn) and saved_turn_counts (per outcome), all absent on an older build. last_response_ms can be a gap between reply chunks when last_clock is resumed_from_server_answer. session_id restarts at 1 with the app process; go by began_at. A session already running when radar was enabled lists from its first seen record, team_id null. get_switchboard_session(id) has the records.",
|
|
236
|
+
description: "List the Slackbot voice (switchboard) sessions the device still holds, at most 8, newest first. A session is one voice conversation attempt, from the controller starting (before any socket opens) to it ending. Each entry carries session_id, team_id, began_at, ended_at (null live), total_captured, frames {incoming, outgoing}, last_state (newest connection/mic/speaking state, absent before the first state record), levels (newest level tick, or null), server_session_id (null until named), turns ({count, last_response_ms, last_clock}, null before the first timed turn) and saved_turn_counts (per outcome), all absent on an older build. last_response_ms can be a gap between reply chunks when last_clock is resumed_from_server_answer. saved_turn_counts counts each outcome, and absent on an older device build means not counted, not zero. A server resend counts again under applied or no_line, so their sum can run above the finals and is not a lost turn. session_id restarts at 1 with the app process; go by began_at. A session already running when radar was enabled lists from its first seen record, team_id null. get_switchboard_session(id) has the records.",
|
|
347
237
|
inputSchema: { type: "object", properties: {} },
|
|
348
238
|
annotations: { readOnlyHint: true },
|
|
349
239
|
},
|
|
350
240
|
{
|
|
351
241
|
name: "get_switchboard_session",
|
|
352
|
-
description: "Get one voice session's summary plus the newest `limit` of its records (events), oldest first; events is only the page. Record kinds: state = connection, mic and speaking transitions (state_kind, from, to, cause); frame = control frames in and out (direction, frame_type, bytes), audio frames carry frame_type audio and a byte count, never the audio; player = playback events rearm, jitter_trim, read_stall and pre_ready_drop with gap_ms and bytes_queued; phase = startup phase durations (phase, duration_ms); session = begin and end, plus ready (server_session_id); levels = one meter-tick batch (started_at, sample_count, offsets_ms, mic/playback rms+peak arrays, 0..1); turn = response_ms (end of speech to first reply audio) and clock (no_card, resumed_from_tap, resumed_from_server_answer); saved_turn = outcome (applied, no_line, missing_field, other_session), has_thread. Pass kind to narrow (player for stutter, levels for meter history); the device filters by kind before taking the limit, so the page is the newest limit of that kind, while total_captured still counts every kind. This is a single page, not the whole session; for that use export_switchboard_session or query_session under source switchboard. An unknown id is a device 404.",
|
|
242
|
+
description: "Get one voice session's summary plus the newest `limit` of its records (events), oldest first; events is only the page. Record kinds: state = connection, mic and speaking transitions (state_kind, from, to, cause); frame = control frames in and out (direction, frame_type, bytes), audio frames carry frame_type audio and a byte count, never the audio; player = playback events rearm, jitter_trim, read_stall and pre_ready_drop with gap_ms and bytes_queued; phase = startup phase durations (phase, duration_ms); session = begin and end, plus ready (server_session_id); levels = one meter-tick batch (started_at, sample_count, offsets_ms, mic/playback rms+peak arrays, 0..1); turn = response_ms (end of speech to first reply audio) and clock (no_card, resumed_from_tap, resumed_from_server_answer); saved_turn = outcome (applied, no_line, missing_field, other_session), has_thread. For saved_turn, no_line means no subtitle line still held the item and the turn is still kept; every turn other_session with a null server_session_id usually means session.ready named no session (a ready record with a null id) or never arrived (no ready record). Pass kind to narrow (player for stutter, state for mic and connection, phase for slow start, levels for meter history); the device filters by kind before taking the limit, so the page is the newest limit of that kind, while total_captured still counts every kind. This is a single page, not the whole session; for that use export_switchboard_session or query_session under source switchboard. An unknown id is a device 404.",
|
|
353
243
|
inputSchema: {
|
|
354
244
|
type: "object",
|
|
355
245
|
properties: {
|
|
@@ -372,7 +262,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
372
262
|
},
|
|
373
263
|
{
|
|
374
264
|
name: "export_switchboard_session",
|
|
375
|
-
description: "Write one Slackbot voice (switchboard) session's summary and its records to a plain-text file. Pages the device (up to 2000 per request, paged with before_id), then merges in this process's own live stream copy (read from its session event spool), so a call the device ring has since evicted can still show up if this MCP was connected while it happened. The export can stop early (for example an old device build that does not page, the 32 MB size cap, the page limit, or the device stopping answering), and the report notes say why anything is missing; the spool itself rotates at 100 MB across every event kind it captures, not just switchboard, so an unusually long or chatty session could in principle rotate away a call's own early records before the device ring would have evicted them. Writes it as a readable report (server_session_id, summary, then one line per record, oldest first) under ~/.slack-radar/exports/<file>, permissions 0700/0600 like capture_snapshot. Defaults to the newest session when id is omitted. Returns the file path, a short summary, and notes. An unknown id (404, unreachable, or a reply too large to read) errors unless this process streamed the call live, then the report comes from the live stream copy alone, whichever process ran the export, since this MCP server and the web dashboard each keep their own. Still works right after Radar auto-disables, from the live stream copy alone with no device call; an explicit /radar-disable or clear_buffers wipes that copy.",
|
|
265
|
+
description: "Write one Slackbot voice (switchboard) session's summary and its records to a plain-text file. Pages the device (up to 2000 per request, paged with before_id), then merges in this process's own live stream copy (read from its session event spool), so a call the device ring has since evicted can still show up if this MCP was connected while it happened. The export can stop early (for example an old device build that does not page, the 32 MB size cap, the page limit, or the device stopping answering), and the report notes say why anything is missing; the spool itself rotates at 100 MB across every event kind it captures, not just switchboard, so an unusually long or chatty session could in principle rotate away a call's own early records before the device ring would have evicted them. Writes it as a readable report (server_session_id, summary, then one line per record, oldest first) under ~/.slack-radar/exports/<file>, permissions 0700/0600 like capture_snapshot. Defaults to the newest session when id is omitted. Returns the file path, a short summary, and notes. An unknown id (404, unreachable, or a reply too large to read) errors unless this process streamed the call live, then the report comes from the live stream copy alone, whichever process ran the export, since this MCP server and the web dashboard each keep their own. Still works right after Radar auto-disables, from the live stream copy alone with no device call; an explicit /radar-disable or clear_buffers wipes that copy. Use when the user asks to export or save a voice session, or to hand it to someone else.",
|
|
376
266
|
inputSchema: {
|
|
377
267
|
type: "object",
|
|
378
268
|
properties: {
|
|
@@ -408,7 +298,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
408
298
|
},
|
|
409
299
|
{
|
|
410
300
|
name: "activate_for_user",
|
|
411
|
-
description: "Activate Slack Radar on a specific Android user profile. Use after list_profiles to switch between the personal user and a secondary user (such as a work profile). Switching profiles restarts log capture with a new session-scoped file and reconnects the SSE event stream so events come from the newly activated profile; old captures remain on disk for up to 7 days. Call this when already connected and only the target profile needs to change.",
|
|
301
|
+
description: "Activate Slack Radar on a specific Android user profile. Use after list_profiles to switch between the personal user and a secondary user (such as a work profile). Switching profiles restarts log capture with a new session-scoped file and reconnects the SSE event stream so events come from the newly activated profile; old captures remain on disk for up to 7 days. Call this when already connected and only the target profile needs to change. If the result has token_via_argv, the token had to go over the command line, and the field says why.",
|
|
412
302
|
inputSchema: {
|
|
413
303
|
type: "object",
|
|
414
304
|
properties: {
|
|
@@ -427,7 +317,8 @@ export const TOOL_DEFINITIONS = [
|
|
|
427
317
|
},
|
|
428
318
|
{
|
|
429
319
|
name: "capture_snapshot",
|
|
430
|
-
description: "Bundle the current Radar state into a single on-disk artifact for sharing. Writes four files to ~/.slack-radar/snapshots/snapshot-<ts>/: bundle.json (network + RTM + clog + trace buffers, up to 1000 items each — a bulk export, much larger than point queries like get_network_call_detail), logcat.tail.log (last N lines of the active capture), screenshot.png (current screen), and README.txt (receiver-facing explainer). Switchboard voice sessions are not bundled; keep them with get_switchboard_session or query_session(source=switchboard). Use when the user says 'save this', 'file this as a bug', 'share this', 'bundle this up', 'attach to a ticket', 'make me a repro', or otherwise wants a shareable reproducible handoff. PRIVACY: bundle.json contains raw API request/response bodies including auth headers, RTM message content, user/team/channel IDs, clog payloads, and performance trace spans — review before sharing externally."
|
|
320
|
+
description: "Bundle the current Radar state into a single on-disk artifact for sharing. Writes four files to ~/.slack-radar/snapshots/snapshot-<ts>/: bundle.json (network + RTM + clog + trace buffers, up to 1000 items each — a bulk export, much larger than point queries like get_network_call_detail), logcat.tail.log (last N lines of the active capture), screenshot.png (current screen), and README.txt (receiver-facing explainer). Switchboard voice sessions are not bundled; keep them with get_switchboard_session or query_session(source=switchboard). Use when the user says 'save this', 'file this as a bug', 'share this', 'bundle this up', 'attach to a ticket', 'make me a repro', or otherwise wants a shareable reproducible handoff. PRIVACY: bundle.json contains raw API request/response bodies including auth headers, RTM message content, user/team/channel IDs, clog payloads, and performance trace spans — review before sharing externally. " +
|
|
321
|
+
"When it returns, tell the user: result.zip_path (the single shareable file), else result.path; a one-line summary of the counts; \"Privacy: \" followed by result.privacy_notice word for word, verbatim and never paraphrased, even under time pressure; if result.log_lines_truncated is true, that the 1 MB read cap cut the log lines; if result.errors is non-empty, which parts failed. If they asked to file it as a bug or attach it to a ticket, offer to attach result.zip_path through the Jira or Slack MCP; do not attach without asking.",
|
|
431
322
|
inputSchema: {
|
|
432
323
|
type: "object",
|
|
433
324
|
properties: {
|
|
@@ -451,7 +342,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
451
342
|
},
|
|
452
343
|
{
|
|
453
344
|
name: "screenshot",
|
|
454
|
-
description: "Capture a screenshot from the connected Android device.",
|
|
345
|
+
description: "Capture a screenshot from the connected Android device. Use when the user asks 'what am I looking at' / 'what screen is this'. Defaults to 720px; pass full_res only when detail matters.",
|
|
455
346
|
inputSchema: {
|
|
456
347
|
type: "object",
|
|
457
348
|
properties: {
|
|
@@ -473,17 +364,19 @@ export const TOOL_DEFINITIONS = [
|
|
|
473
364
|
},
|
|
474
365
|
{
|
|
475
366
|
name: "clear_buffers",
|
|
476
|
-
description: "Clear all captured network calls
|
|
367
|
+
description: "Clear all captured network calls, RTM events and settled test runs from both device and local buffers.",
|
|
477
368
|
inputSchema: { type: "object", properties: {} },
|
|
478
369
|
annotations: { destructiveHint: true },
|
|
479
370
|
},
|
|
480
371
|
{
|
|
481
372
|
name: "_radar_session_enable",
|
|
482
|
-
description: "Enable Slack Radar for this session. Sets up ADB forwarding, activates the device-side server, and connects the SSE stream. Called by /radar-enable skill.
|
|
373
|
+
description: "Enable Slack Radar for this session. Sets up ADB forwarding, activates the device-side server, and connects the SSE stream. Called by /radar-enable skill. Safe to repeat: on an already enabled session it checks the device first and returns the current status with already_enabled: true. It runs the full setup again when that check fails or the last activation did not land, the device, token or profile changed, the timeout changes, or Radar is in open mode. For a clean reset run /radar-disable, then /radar-enable. If it has token_via_argv, the token had to go over the command line, and the field says why. " +
|
|
374
|
+
"With more than one device attached, enable fails and returns the list of attached serials. Retry with device_serial set to one of them. When you cannot tell which device the user means, ask which device before retrying; do not guess. The success response names the bound device in device_label, so confirm it matches what the user expected. The picked device applies to every tool for the whole session. Profiles are separate users on ONE device (personal vs work); devices are separate hardware. " +
|
|
375
|
+
"If the result has a warning field, show it to the user verbatim.",
|
|
483
376
|
inputSchema: {
|
|
484
377
|
type: "object",
|
|
485
378
|
properties: {
|
|
486
|
-
timeout_minutes: { type: "number", description: "Device-side auto-shutdown timeout in minutes (default
|
|
379
|
+
timeout_minutes: { type: "number", description: "Device-side auto-shutdown timeout in minutes (default 5 on first enable, a repeat keeps the current window)" },
|
|
487
380
|
device_serial: {
|
|
488
381
|
type: "string",
|
|
489
382
|
description: "Target device serial from adb devices. Optional; auto-selected when exactly one device is attached. When multiple devices are attached the enable fails with the list; retry with one of the listed serials.",
|
|
@@ -504,9 +397,13 @@ export const TOOL_DEFINITIONS = [
|
|
|
504
397
|
"Suggest this when the user describes a live view the pre-built tabs (Live/Network/RTM/Clogs/Traces/Logs/Switchboard, plus the Database, Preferences and Feature Flags browsers) do not cover " +
|
|
505
398
|
"(e.g. 'graph calls per second vs response time and flag slow ones', 'beep when I get a DM'); invoke it once they agree. " +
|
|
506
399
|
"Translate the request into the spec fields below and call this tool; it ensures the web dashboard is " +
|
|
507
|
-
"running (default http://localhost:8100) and renders your spec as a 'Custom' tab, then returns the URL to share. " +
|
|
400
|
+
"running (default http://localhost:8100, or the port set in SLACK_RADAR_WEB_PORT) and renders your spec as a 'Custom' tab, then returns the URL to share. " +
|
|
508
401
|
"Calling again replaces/refines it. Does not open a browser window for the user. The dashboard reads a connected " +
|
|
509
|
-
"device, so Radar must be armed to show data (the dashboard has its own Reconnect button). Debug builds only, local only."
|
|
402
|
+
"device, so Radar must be armed to show data (the dashboard has its own Reconnect button). Debug builds only, local only. " +
|
|
403
|
+
"Each pre-built tab has a filterable feed and a payload inspector, a live rate on most, a graph on Network and Traces. " +
|
|
404
|
+
"Screen overlay: the dashboard has a Screen button that mirrors the live device screen in a side panel, plus a full-resolution screenshot and screen recording. It is off by default and opens to a consent notice first, because it shows real on-screen content (open DMs, messages). The live mirror needs ffmpeg on the user's machine; the screenshot does not. If the user wants the live screen and ffmpeg is missing, say so plainly, give the install command (mac: `brew install ffmpeg`; debian/ubuntu: `sudo apt install ffmpeg`; windows: `winget install ffmpeg`) and note the screenshot works without it. NEVER run the install for them. The dashboard's /health response reports screen.ffmpeg / screen.liveCast / screen.installHint, so you can check first. " +
|
|
405
|
+
"Constrained log view example: {source: \"log\", match: {package: \"<the debug package ping reports>\", tag: \"<Tag>\"}, minLevel: \"DEBUG\", exclude: [\"noisy term\"]}. It lands as a Custom tab, gone on a page refresh unless pushed again; exclude terms are remembered in the browser only on the pre-built tabs, not on Custom. " +
|
|
406
|
+
"The voice viz is the Switchboard tab's session panel and draws only for source switchboard.",
|
|
510
407
|
inputSchema: {
|
|
511
408
|
type: "object",
|
|
512
409
|
properties: {
|
|
@@ -632,7 +529,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
632
529
|
cursor: { type: "string", description: "An OPAQUE paging token returned by a prior truncated result; pass it back verbatim to get the next older page across all sources. It is NOT an event id and NOT a count; do not construct or modify it. A token from before a spool rotation or a re-enable is rejected with a note, and you start paging from the newest page again." },
|
|
633
530
|
url_filter: { type: "string", description: "Keep frames whose url contains this substring." },
|
|
634
531
|
status_code: { type: "number", description: "Keep frames with this exact HTTP status code." },
|
|
635
|
-
event_type: { type: "string", description: "Keep frames with this exact event_type (RTM)." },
|
|
532
|
+
event_type: { type: "string", description: "Keep frames with this exact event_type (RTM). The match is case-sensitive, so use the subtype in lower case when there is one (message_changed, not message)." },
|
|
636
533
|
channel: { type: "string", description: "Keep frames with this exact channel id (RTM)." },
|
|
637
534
|
name: { type: "string", description: "Keep frames whose name contains this substring (clog/trace)." },
|
|
638
535
|
text: { type: "string", description: "Keep frames whose serialized JSON contains this substring anywhere (searches the whole frame, including clog detail)." },
|
|
@@ -644,7 +541,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
644
541
|
},
|
|
645
542
|
{
|
|
646
543
|
name: "list_prefs",
|
|
647
|
-
description: "List the app's SharedPreferences XML files (including feature-flag files like debug_features_*.xml, which holds manual overrides, and easy_features_*.xml, the persisted server snapshot), with file sizes and the Android user they were read from.",
|
|
544
|
+
description: "List the app's SharedPreferences XML files (including feature-flag files like debug_features_*.xml, which holds manual overrides, and easy_features_*.xml, the persisted server snapshot), with file sizes and the Android user they were read from. Use when the user asks 'what did the app remember' / 'what is cached in prefs' / 'what team_prefs are set'; then get_prefs.",
|
|
648
545
|
inputSchema: {
|
|
649
546
|
type: "object",
|
|
650
547
|
properties: {
|
|
@@ -694,7 +591,9 @@ export const TOOL_DEFINITIONS = [
|
|
|
694
591
|
},
|
|
695
592
|
{
|
|
696
593
|
name: "list_feature_flags",
|
|
697
|
-
description: "List every feature flag the app knows about right now, with its EFFECTIVE value (local override if set, else the server value) and whether that value is a local override. One key appears once per scope and once per signed-in org, each row carrying its own value (plus an org_id on authenticated rows, when the device build reports one), so total_rows counts rows while total_flags counts distinct flags.
|
|
594
|
+
description: "List every feature flag the app knows about right now, with its EFFECTIVE value (local override if set, else the server value) and whether that value is a local override. One key appears once per scope and once per signed-in org, each row carrying its own value (plus an org_id on authenticated rows, when the device build reports one), so total_rows counts rows while total_flags counts distinct flags. `enabled` is the latest value. " +
|
|
595
|
+
SESSION_VALUE_NOTE +
|
|
596
|
+
" Unlike get_prefs/search_prefs on debug_features_*.xml, which shows only manual overrides. Requires a debug build with the feature-flag Radar plugin; older builds report a clear error instead of the list.",
|
|
698
597
|
inputSchema: {
|
|
699
598
|
type: "object",
|
|
700
599
|
properties: {
|
|
@@ -705,7 +604,9 @@ export const TOOL_DEFINITIONS = [
|
|
|
705
604
|
},
|
|
706
605
|
{
|
|
707
606
|
name: "search_feature_flags",
|
|
708
|
-
description: "Case-insensitive substring search on feature flag names, against the same live effective-value list as list_feature_flags. One key can match several rows, one per scope and per signed-in org, so matched_rows counts rows and matched_flags counts distinct flags.
|
|
607
|
+
description: "Case-insensitive substring search on feature flag names, against the same live effective-value list as list_feature_flags. One key can match several rows, one per scope and per signed-in org, so matched_rows counts rows and matched_flags counts distinct flags. " +
|
|
608
|
+
SESSION_VALUE_NOTE +
|
|
609
|
+
" Use this instead of search_prefs when you need a flag's latest value, not just whether it has a manual override.",
|
|
709
610
|
inputSchema: {
|
|
710
611
|
type: "object",
|
|
711
612
|
properties: {
|
|
@@ -717,7 +618,9 @@ export const TOOL_DEFINITIONS = [
|
|
|
717
618
|
},
|
|
718
619
|
{
|
|
719
620
|
name: "get_feature_flag",
|
|
720
|
-
description: "Look up one feature flag by its exact key (case-sensitive) and return its effective value and override status.
|
|
621
|
+
description: "Look up one feature flag by its exact key (case-sensitive) and return its latest effective value and override status. " +
|
|
622
|
+
SESSION_VALUE_NOTE +
|
|
623
|
+
" Always returns rows: an array, because one key resolves along two axes. Scope (authenticated = the value for a signed-in user, unauthenticated = a visitor who has not signed in yet), and org: each signed-in workspace resolves its own value, so a flag can be ON in one workspace and OFF in another and each gets its own row with an org_id. A bare lookup returns one row per (scope, org), so read every row rather than the first one, and pass scope and/or org_id to narrow. On builds that report it, rows also carry timestamp, the device clock when that row was written, which tells an older row from a newer one. Use list_feature_flags or search_feature_flags first if you are not sure of the exact key.",
|
|
721
624
|
inputSchema: {
|
|
722
625
|
type: "object",
|
|
723
626
|
properties: {
|
|
@@ -729,6 +632,38 @@ export const TOOL_DEFINITIONS = [
|
|
|
729
632
|
},
|
|
730
633
|
annotations: { readOnlyHint: true },
|
|
731
634
|
},
|
|
635
|
+
{
|
|
636
|
+
name: "run_test_case",
|
|
637
|
+
description: "Replay a case of made-up RTM frames into the app's own message handler on the device. case is a built-in name (message_changed, message_replied: a seed message then its update, 100 pairs at 10 frames a second) or the stem of ~/.slack-radar/test-cases/<name>.json, which replaces a built-in of the same name. Frames per run = repeat × events, and the rate counts every frame. Then call get_test_run(run_id, wait_seconds) until settled. A 409 active names active_run_id: get_test_run or stop_test_run it. A 409 settling, N ms left: wait that long and retry. A 400 names the refused frame. Debug builds that serve test_runs only.",
|
|
638
|
+
inputSchema: {
|
|
639
|
+
type: "object",
|
|
640
|
+
properties: {
|
|
641
|
+
case: { type: "string", description: "Built-in name or case file stem." },
|
|
642
|
+
repeat: { type: "integer", minimum: 1, description: "Times the case's events are sent. Default from the case." },
|
|
643
|
+
rate_per_second: { type: ["number", "null"], minimum: 1, maximum: 1000, description: "Frames a second, 1 to 1000, or null for a burst. Default from the case." },
|
|
644
|
+
},
|
|
645
|
+
required: ["case"],
|
|
646
|
+
},
|
|
647
|
+
annotations: { readOnlyHint: false },
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
name: "get_test_run",
|
|
651
|
+
description: "Read one replay run, or the last ten with active_run_id when run_id is omitted. wait_seconds (max 45) polls until settled; it bounds when the last read starts and each read gets 3 s; an unsettled answer carries a note, call again. settled turns true 2 quiet s after the later of the run's end and its last counted event; frames still pending hold it up to 10 s after the end, then count as ignored. Trust summary only once settled: ok and failed count handler outcomes. by_type keys can be dotted, read summary.by_type[\"MESSAGE.MESSAGE_CHANGED\"] for sent, ok, failed, max_ms and p50_ms/p90_ms/p99_ms (null under 100 counted events of that type). stop_reason and summary.failed_label say why a run ended early. elapsed_ms, achieved_rate, drain_ms, held_ms and late_sends are null until the run ends. An unknown run_id is a 404. clear_buffers drops settled runs, read them first.",
|
|
652
|
+
inputSchema: {
|
|
653
|
+
type: "object",
|
|
654
|
+
properties: {
|
|
655
|
+
run_id: { type: "string" },
|
|
656
|
+
wait_seconds: { type: "integer", minimum: 0, maximum: 45 },
|
|
657
|
+
},
|
|
658
|
+
},
|
|
659
|
+
annotations: { readOnlyHint: true },
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
name: "stop_test_run",
|
|
663
|
+
description: "Stop a replay run. 202 with the run while it stops, 200 once it has already ended, 404 unknown, 409 while still starting (retry in a moment). Its counts stay readable with get_test_run.",
|
|
664
|
+
inputSchema: { type: "object", properties: { run_id: { type: "string" } }, required: ["run_id"] },
|
|
665
|
+
annotations: { readOnlyHint: false, idempotentHint: true },
|
|
666
|
+
},
|
|
732
667
|
];
|
|
733
668
|
/**
|
|
734
669
|
* Check whether a tool call should be blocked by the session gate.
|
|
@@ -764,7 +699,7 @@ export function sessionGate(toolName, sessionEnabled, allowSwitchboardExportOffl
|
|
|
764
699
|
{
|
|
765
700
|
type: "text",
|
|
766
701
|
text: JSON.stringify({
|
|
767
|
-
error: "Radar is not active.
|
|
702
|
+
error: "Radar is not active. Run /radar-enable, then retry this call.",
|
|
768
703
|
}),
|
|
769
704
|
},
|
|
770
705
|
],
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// here makes the boundary assertable without importing a server.
|
|
8
8
|
import { RADAR_PORT } from "../shared/constants.js";
|
|
9
9
|
export function webChildEnv(initialSpec, target) {
|
|
10
|
-
|
|
10
|
+
const env = {
|
|
11
11
|
...process.env,
|
|
12
12
|
...(target ? { SLACK_RADAR_PLATFORM: target.platform } : {}),
|
|
13
13
|
...(target?.platform === "ios" && target.serial
|
|
@@ -35,4 +35,5 @@ export function webChildEnv(initialSpec, target) {
|
|
|
35
35
|
// and a lost race leaves the Live preset showing after the Custom tab was reported live.
|
|
36
36
|
...(initialSpec ? { SLACK_RADAR_INITIAL_SPEC: JSON.stringify(initialSpec) } : {}),
|
|
37
37
|
};
|
|
38
|
+
return env;
|
|
38
39
|
}
|