repl: :mcp tool — disambiguate "no alias" vs "unknown alias" errors

Surfaced by Phase 7 verify test case #29: typing :mcp tool list_dir (no
dot) printed "unknown alias: nil" instead of a useful diagnostic. The
parse failure was being conflated with the alias-not-found case.

Now:
  :mcp tool list_dir          -> tool name missing alias prefix: list_dir
  :mcp tool unknown_alias.x   -> unknown alias: unknown_alias
  :mcp tool known_alias.bogus -> unknown tool: known_alias.bogus

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-12 18:55:01 +00:00
parent 09800d192a
commit 3fa6279f5b
+6 -2
View File
@@ -483,9 +483,13 @@ function M.run(config)
renderer.status("usage: :mcp tool <alias.name>"); return
end
local alias, tname = name:match("^([^.]+)%.(.+)$")
local sess = alias and mcp_sessions[alias]
if not alias then
renderer.status("tool name missing alias prefix: " .. name)
return
end
local sess = mcp_sessions[alias]
if not sess then
renderer.status("unknown alias: " .. tostring(alias))
renderer.status("unknown alias: " .. alias)
return
end
local found