Report MCP tool discovery errors in server status (#42598)

## Why

An empty tool map does not distinguish a successfully returned empty catalog from a server whose startup or tool discovery failed.

## What changed

- Add nullable `toolsError` to each `mcpServerStatus/list` entry when no catalog is available because startup or tool discovery failed.
- Keep `toolsError` null for returned catalogs, including cached and empty catalogs, and continue returning healthy servers when another server fails.
- Update the protocol schemas and generated TypeScript type.

## Testing

- Extend the app-server status integration test with a broken MCP server and verify its error without losing the healthy server's inventory.

GitOrigin-RevId: 30b4ca4d9a45cec6998f5f626d3fddbee90a525d
This commit is contained in:
victor-openai authored and copyberry committed 2026-09-03 18:36:58 +00:00
1 parent f60dfe80b5
commit 8f31b64c7f
19 files changed
+108 -30

No files matched your search

@@ -28,6 +28,7 @@ fn mcp_inventory_connection_states() {
plugin_id: None,
server_info: None,
tools: HashMap::new(),
tools_error: None,
resources: Vec::new(),
resource_templates: Vec::new(),
auth_status: McpAuthStatus::Unknown,
+2
View File
@@ -987,6 +987,7 @@ async fn mcp_tools_output_lists_tools_for_hyphenated_server_names() {
#[test]
fn mcp_tools_output_from_statuses_renders_status_only_servers() {
let statuses = vec![McpServerStatus {
tools_error: None,
name: "plugin_docs".to_string(),
runtime_status: None,
plugin_id: None,
@@ -1019,6 +1020,7 @@ fn mcp_tools_output_from_statuses_renders_status_only_servers() {
#[test]
fn mcp_tools_output_from_statuses_renders_verbose_inventory() {
let statuses = vec![McpServerStatus {
tools_error: None,
name: "plugin_docs".to_string(),
runtime_status: None,
plugin_id: None,