Skip to content

Commit 1b61454

Browse files
committed
fix(schema): align schemas with handler args for ssh_diff, ssh_edit, ssh_tail, ssh_monitor, ssh_health_check, ssh_service_status, ssh_journalctl, ssh_docker, ssh_tail_start, ssh_tail_read, ssh_session_memory. Removes ghost fields that handlers never read; replaces camelCase schema fields on 'raw' tools with actual snake_case ones the handler expects.
1 parent 5c2fbfa commit 1b61454

1 file changed

Lines changed: 44 additions & 47 deletions

File tree

src/index.js

Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -648,13 +648,14 @@ registerToolConditional(
648648
registerToolConditional(
649649
'ssh_tail',
650650
{
651-
description: 'Tail remote log files (sessionized follow mode, grep filter, format-aware)',
651+
description: 'Tail remote log file once (last N lines, optional grep). For live streaming use ssh_tail_start.',
652652
inputSchema: {
653653
server: z.string().describe('Server name from configuration'),
654654
file: z.string().describe('Path to the log file to tail'),
655-
lines: z.number().optional().describe('Number of lines to show initially (default: 100)'),
656-
follow: z.boolean().optional().describe('Follow file for new content (default: false)'),
657-
grep: z.string().optional().describe('Filter lines with grep pattern'),
655+
lines: z.number().optional().describe('Number of trailing lines to return (default: 50)'),
656+
grep: z.string().optional().describe('Extended-regex filter applied before output truncation'),
657+
timeout: z.number().optional().describe('Command timeout in ms (default 120000)'),
658+
maxLen: z.number().optional().describe('Output truncation cap in chars (default 10000)'),
658659
format: z.enum(['markdown', 'json']).optional().describe('Output format')
659660
}
660661
},
@@ -664,12 +665,10 @@ registerToolConditional(
664665
registerToolConditional(
665666
'ssh_monitor',
666667
{
667-
description: 'Monitor system resources (CPU, RAM, disk, network) -- typed output',
668+
description: 'Point-in-time system snapshot: cpu, memory, disk, network, process, or full overview',
668669
inputSchema: {
669670
server: z.string().describe('Server name from configuration'),
670-
type: z.enum(['overview', 'cpu', 'memory', 'disk', 'network', 'process']).optional().describe('Monitor type'),
671-
interval: z.number().optional().describe('Update interval in seconds'),
672-
duration: z.number().optional().describe('Duration in seconds'),
671+
type: z.enum(['overview', 'cpu', 'memory', 'disk', 'network', 'process']).optional().describe('Which subsystem to snapshot (default: overview)'),
673672
format: z.enum(['markdown', 'json']).optional().describe('Output format')
674673
}
675674
},
@@ -1869,10 +1868,9 @@ registerToolConditional(
18691868
registerToolConditional(
18701869
'ssh_health_check',
18711870
{
1872-
description: 'Comprehensive health check (single-shot bash -c with marker-delimited sections)',
1871+
description: 'Comprehensive health snapshot (cpu, memory, disk, load, uptime, cores) via one bash -c call with marker-delimited sections',
18731872
inputSchema: {
18741873
server: z.string().describe('Server name'),
1875-
detailed: z.boolean().optional().describe('Include network, load average'),
18761874
format: z.enum(['markdown', 'json']).optional().describe('Output format')
18771875
}
18781876
},
@@ -1882,10 +1880,10 @@ registerToolConditional(
18821880
registerToolConditional(
18831881
'ssh_service_status',
18841882
{
1885-
description: 'Check service status (batch-safe parsing, typed health rollup)',
1883+
description: 'Typed systemd service status (ActiveState/SubState/LoadState/UnitFileState + last 10 status lines)',
18861884
inputSchema: {
18871885
server: z.string().describe('Server name'),
1888-
services: z.array(z.string()).describe('Service names'),
1886+
service: z.string().describe('Service unit name (e.g. "nginx" or "nginx.service")'),
18891887
format: z.enum(['markdown', 'json']).optional().describe('Output format')
18901888
}
18911889
},
@@ -2289,16 +2287,17 @@ registerToolConditional(
22892287
registerToolConditional(
22902288
'ssh_journalctl',
22912289
{
2292-
description: 'Read systemd journal (typed JSONL, priority normalization)',
2290+
description: 'Read systemd journal (typed JSONL; priority normalization; no follow -- use ssh_tail_start for streaming)',
22932291
inputSchema: {
22942292
server: z.string().describe('Server name'),
2295-
unit: z.string().optional().describe('Unit to filter by'),
2296-
since: z.string().optional().describe('Time filter (e.g., "1 hour ago")'),
2297-
until: z.string().optional().describe('Upper bound'),
2293+
unit: z.string().optional().describe('Unit to filter by (e.g. "sshd.service")'),
2294+
since: z.string().optional().describe('Time lower bound (e.g., "1 hour ago", "2026-04-14 12:00")'),
2295+
until: z.string().optional().describe('Time upper bound'),
2296+
priority: z.string().optional().describe('Priority filter (debug/info/notice/warning/err/crit/alert/emerg, default info)'),
22982297
lines: z.number().optional().describe('Max lines'),
2299-
priority: z.string().optional().describe('Priority filter'),
2300-
grep: z.string().optional().describe('Regex filter'),
2301-
output: z.enum(['json', 'text']).optional().describe('Journal output mode'),
2298+
grep: z.string().optional().describe('Extended-regex filter on message body'),
2299+
follow: z.boolean().optional().describe('Rejected -- use ssh_tail_start for streaming'),
2300+
json: z.boolean().optional().describe('Parse journal output as JSONL (default true); set false to parse as plain text'),
23022301
format: z.enum(['markdown', 'json']).optional().describe('Tool output format')
23032302
}
23042303
},
@@ -2308,17 +2307,16 @@ registerToolConditional(
23082307
registerToolConditional(
23092308
'ssh_docker',
23102309
{
2311-
description: 'Docker CLI wrapper (container/image regex validation, irreversibility flags)',
2310+
description: 'Docker CLI wrapper (container/image regex validation, preview on mutations)',
23122311
inputSchema: {
23132312
server: z.string().describe('Server name'),
23142313
action: z.enum(['ps', 'images', 'inspect', 'logs', 'start', 'stop', 'restart', 'rm', 'rmi', 'pull', 'exec']).describe('Docker action'),
23152314
container: z.string().optional().describe('Container name/ID'),
23162315
image: z.string().optional().describe('Image reference'),
2317-
command: z.string().optional().describe('exec command'),
2318-
lines: z.number().optional().describe('logs tail lines'),
2319-
all: z.boolean().optional().describe('ps -a / images -a'),
2320-
force: z.boolean().optional().describe('rm -f / rmi -f'),
2321-
preview: z.boolean().optional().describe('Preview mutating actions'),
2316+
command: z.string().optional().describe('exec command (for action=exec)'),
2317+
tail_lines: z.number().optional().describe('logs tail line count'),
2318+
follow: z.boolean().optional().describe('logs -f streaming (only meaningful for action=logs)'),
2319+
preview: z.boolean().optional().describe('Preview mutating actions (start/stop/restart/rm/rmi/pull/exec)'),
23222320
format: z.enum(['markdown', 'json']).optional().describe('Output format')
23232321
}
23242322
},
@@ -2345,13 +2343,13 @@ registerToolConditional(
23452343
registerToolConditional(
23462344
'ssh_diff',
23472345
{
2348-
description: 'Diff remote file vs local/remote (sha256-first fast path)',
2346+
description: 'Diff two files (same-server remote:remote, or cross-server by specifying server_b)',
23492347
inputSchema: {
2350-
server: z.string().describe('Server name'),
2351-
remote_path: z.string().describe('Remote file'),
2352-
local_path: z.string().optional().describe('Local file to diff against'),
2353-
against: z.string().optional().describe('Another remote path to diff against'),
2354-
context: z.number().optional().describe('Context lines'),
2348+
server: z.string().describe('Server hosting path_a'),
2349+
path_a: z.string().describe('First file path'),
2350+
path_b: z.string().describe('Second file path (on `server` unless server_b set)'),
2351+
server_b: z.string().optional().describe('If set, path_b lives on this other server (cross-server diff)'),
2352+
preview: z.boolean().optional().describe('Show plan without running diff'),
23552353
format: z.enum(['markdown', 'json']).optional().describe('Output format')
23562354
}
23572355
},
@@ -2361,13 +2359,16 @@ registerToolConditional(
23612359
registerToolConditional(
23622360
'ssh_edit',
23632361
{
2364-
description: 'Atomic safe-edit (tmp -> syntax-check -> backup -> mv swap, preview-capable)',
2362+
description: 'Atomic safe-edit (tmp -> optional syntax-check -> cp backup -> mv swap, preview-capable)',
23652363
inputSchema: {
23662364
server: z.string().describe('Server name'),
23672365
path: z.string().describe('Remote file path'),
2368-
content: z.string().optional().describe('New content'),
2369-
encoding: z.enum(['utf8', 'base64']).optional().describe('Content encoding'),
2370-
syntax_check: z.string().optional().describe('Syntax check command (e.g., "nginx -t")'),
2366+
new_content: z.string().optional().describe('Replacement content for the whole file (mutually exclusive with patch)'),
2367+
patch: z.array(z.object({
2368+
find: z.string().describe('Literal string to replace'),
2369+
replace: z.string().describe('Replacement'),
2370+
})).optional().describe('List of find/replace edits to apply in order (mutually exclusive with new_content)'),
2371+
syntax_check: z.union([z.string(), z.enum(['auto', 'off'])]).optional().describe('Syntax checker: "auto" picks by extension, "off" disables, or a literal command'),
23712372
preview: z.boolean().optional().describe('Show plan without editing'),
23722373
format: z.enum(['markdown', 'json']).optional().describe('Output format')
23732374
}
@@ -2378,13 +2379,12 @@ registerToolConditional(
23782379
registerToolConditional(
23792380
'ssh_tail_start',
23802381
{
2381-
description: 'Start a sessionized tail follow (ring-buffered, readable later)',
2382+
description: 'Start a sessionized tail follow. Returns session_id; read new output later with ssh_tail_read; stop with ssh_tail_stop.',
23822383
inputSchema: {
23832384
server: z.string().describe('Server name'),
23842385
file: z.string().describe('Path to log file'),
2385-
lines: z.number().optional().describe('Initial tail lines'),
2386-
grep: z.string().optional().describe('Grep filter'),
2387-
buffer_size: z.number().optional().describe('Ring buffer size'),
2386+
lines: z.number().optional().describe('Initial trailing lines to emit (default 50)'),
2387+
grep: z.string().optional().describe('Extended-regex filter'),
23882388
format: z.enum(['markdown', 'json']).optional().describe('Output format')
23892389
}
23902390
},
@@ -2394,10 +2394,10 @@ registerToolConditional(
23942394
registerToolConditional(
23952395
'ssh_tail_read',
23962396
{
2397-
description: 'Read buffered output from a tail session',
2397+
description: 'Pull buffered output from a tail session started with ssh_tail_start. Cursor-style: pass since_offset to resume from a known point.',
23982398
inputSchema: {
2399-
session_id: z.string().describe('Tail session ID'),
2400-
max_lines: z.number().optional().describe('Max lines to return'),
2399+
session_id: z.string().describe('Tail session ID returned by ssh_tail_start'),
2400+
since_offset: z.number().optional().describe('Resume from this byte offset (returned as total_bytes on prior read). Omit to return the current ring buffer window.'),
24012401
format: z.enum(['markdown', 'json']).optional().describe('Output format')
24022402
}
24032403
},
@@ -2432,12 +2432,9 @@ registerToolConditional(
24322432
registerToolConditional(
24332433
'ssh_session_memory',
24342434
{
2435-
description: 'Read/write session-scoped memory KV store',
2435+
description: 'Snapshot the inferred memory/state of a running session (env vars set, cwd, last exit code, etc.)',
24362436
inputSchema: {
2437-
session_id: z.string().describe('Session ID'),
2438-
action: z.enum(['get', 'set', 'delete', 'list']).describe('Action'),
2439-
key: z.string().optional().describe('Memory key'),
2440-
value: z.string().optional().describe('Value to set'),
2437+
session_id: z.string().describe('Session ID returned by ssh_session_start'),
24412438
format: z.enum(['markdown', 'json']).optional().describe('Output format')
24422439
}
24432440
},

0 commit comments

Comments
 (0)