Skip to content

workspace_symbol_search reports generic 'no server configured' instead of NoServerForTool/NoServerForLanguage #242

Description

@bug-ops

Description

Translator::get_client_for_file (used by every per-file tool handler) distinguishes two distinct failure modes when no server can serve a request:

  • Error::NoServerForLanguage(lang) — no server at all is configured/applicable for the file's language.
  • Error::NoServerForTool { language_id, tool } — a server is configured for the language, but no server's handles list (or catch-all) claims this specific tool.

Translator::handle_workspace_symbol, which has no file to detect a language from and resolves via ToolRouter::resolve_any instead of resolve, collapses both cases into the single generic Error::NoServerConfigured ("no LSP server configured").

Since #228 introduced per-tool handles routing, it is now possible to have a fully configured, running LSP server for a language that simply does not claim workspace_symbols in its handles list (with no catch-all for that language) — ToolRouter::from_configs even logs a tracing::warn! for exactly this case at startup. When a client then calls the workspace_symbol_search MCP tool, it gets the same "no LSP server configured" message it would get if nothing were running at all, which is misleading and unhelpful for diagnosing a routing/config mistake.

Reproduction Steps

  1. Configure a single [[lsp_servers]] entry for a language with handles = ["hover"] (no catch-all, so workspace_symbols is unclaimed).
  2. Start mcpls; observe the startup warning: language '<lang>' has no catch-all server and does not claim: ... workspace_symbols ....
  3. Call the workspace_symbol_search MCP tool.
  4. Observe the error: no LSP server configured.

Expected Behavior

An error that names the specific gap, analogous to the per-file path, e.g. no server handles tool 'workspace_symbols' — or at minimum distinguishes "nothing running" from "nothing claims this tool" the same way resolve/get_client_for_file already do.

Actual Behavior

Generic Error::NoServerConfigured in both cases, indistinguishable from an empty configuration.

Environment

Logs / Evidence

  • crates/mcpls-core/src/bridge/translator.rs: get_client_for_file (~line 675) vs handle_workspace_symbol (~line 1247) resolution paths.
  • crates/mcpls-core/src/config/routing.rs: ToolRouter::resolve_any has no equivalent of resolve's explicit/catch-all distinction surfaced to the caller, and no has_language-style helper for the language-less case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low: cosmetic, edge case unlikely in practicebugSomething isn't workingmcpls-coremcpls-core crate changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions