Skip to content

Conversation

@sanskritipatole
Copy link
Contributor

Issue #, if available:

Description of changes:

  • Aggregate prompts from proxy servers in prompts/list
  • Fallback to proxy servers in prompts/get when not found locally
  • Add error logging for proxy failures

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment on lines +233 to +235
} catch (Exception e) {
LOG.error("Failed to fetch prompts from proxy: " + proxy.name(), e);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not silently swallow. Don't do anything, if there is an exception let it bubble up.

Comment on lines +256 to +267
for (McpServerProxy proxy : proxies.values()) {
try {
var response = proxy.rpc(req).join();
if (response.getError() == null) {
return createSuccessResponse(req.getId(), response.getResult());
}
} catch (Exception e) {
LOG.error("Failed to get prompt from proxy: " + proxy.name(), e);
}
}

throw new RuntimeException("Prompt not found: " + promptName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why try again from the Proxy? This goes against the MCP spec too, if a prompt wasn't broadcasted as a part of list/prompts then it should not be returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants