Add package imports to MCP blog#4615
Merged
navaneethsnair1 merged 3 commits intostagingfrom Jan 22, 2026
Merged
Conversation
update prod
e8a0fda to
d9fe2f3
Compare
Azquelt
previously approved these changes
Nov 21, 2025
donbourne
reviewed
Nov 21, 2025
Comment on lines
+167
to
+170
| String[] citiesArray = { "London", "Japan", "New York" }; | ||
| for (String city : citiesArray) { | ||
| cancellation.skipProcessingIfCancelled(); | ||
| System.out.println(city); |
Member
There was a problem hiding this comment.
not sure I get what the citiesArray is for here (since it seems to just determine how many times you call skipProcessingIfCancelled()). Also, not sure what the println is for.
Member
There was a problem hiding this comment.
ohhh. I think you were just trying to show something being processed... but that seems like an odd example, since System.out.println calls would be so fast.
Member
Author
There was a problem hiding this comment.
I've tried adding a better example below with the most recent commit:
@Tool(name = "processLargeDataset", title = "Process Large Dataset", description = "Processes data in chunks. Can be cancelled by the client.")
public String processLargeDataset(Cancellation cancellation) {
String[] itemsToProcess = { "Item1", "Item2", "Item3" };
List<String> processedItems = new ArrayList<>();
for (String item : itemsToProcess) {
// Throws exception if client requests cancellation
cancellation.skipProcessingIfCancelled();
// Simulates a long running process
processItem(item);
processedItems.add(item);
}
return processedItems.toString();
}
Member
There was a problem hiding this comment.
thanks Habib, I like that better.
Azquelt
approved these changes
Nov 24, 2025
mbroz2
approved these changes
Nov 25, 2025
donbourne
approved these changes
Nov 25, 2025
ayoho
approved these changes
Nov 26, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the MCP blog, the package imports are now included within the code snippets. Here is a preview in the draft site https://blogs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/blog/2025/10/23/mcp-standalone-blog.html