Skip to content

Commit 6e2b0e2

Browse files
committed
26.0.0.3_beta
1 parent 44abd34 commit 6e2b0e2

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

posts/2026-03-10-26.0.0.3-beta.adoc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ See also link:{url-prefix}/blog/?search=beta&key=tag[previous Open Liberty beta
3636

3737
The link:https://modelcontextprotocol.io/docs/getting-started/intro[Model Context Protocol (MCP)] is an open standard that enables AI applications to access real-time information from external sources. The Liberty MCP Server feature (`mcpServer-1.0`) allows developers to expose the business logic of their applications, allowing it to be integrated into agentic AI workflows.
3838

39-
When a client calls a tool, the object returned by the tool method is converted to a `ToolResponse`, which usually contains one or more `Content` objects. The `ToolResponse` maps directly to the result returned in the response.
39+
When a client calls a tool, the object that is returned by the tool method is converted to a `ToolResponse`, which usually contains one or more `Content` objects. The `ToolResponse` maps directly to the result returned in the response.
4040

41-
If you need more control over the response from your tool, you can return a `ToolResponse` or `Content` object directly, but now it's also possible to register encoders to control how other objects are converted into a response.
41+
If you need more control over the response from your tool, you can return a `ToolResponse` or `Content` object directly. Now it is also possible to register encoders to control how other objects are converted into a response.
4242

4343
* Use `ToolResponseEncoder` to convert an object into a `ToolResponse`, which gives you complete control over the whole response.
44-
* Use `ContentEncoder` when you only need to convert an object into a `Content` that will be included in the response. This also allows you to return a list of objects, and each object will be individually converted into a `Content` and included in the response.
44+
* Use `ContentEncoder` only when you need to convert an object into a `Content` that is included in the response. You can also return a list of objects, and each object is individually converted into a `Content` and included in the response.
4545

46-
If a tool method returns an object for which no encoder is provided, JSON-B is used to encode the object as JSON which is returned as text content.
46+
If a tool method returns an object for which no encoder is provided, JSON-B encodes the object as JSON, which is returned as text content.
4747

4848
=== Example
4949

50-
Say you have a tool which does a search over some datastore:
50+
Consider a tool which does a search over some datastore:
5151

5252
[source,java]
5353
----
@@ -58,11 +58,11 @@ public SearchResult search(@ToolArg(name="query", description="the query to run"
5858
}
5959
----
6060

61-
Imagine that the `SearchResult` object includes a list of results which includes a summary, some metadata, and an indication of how relevant the result is to the query.
61+
In this scenario, the `SearchResult` object encapsulates a list of individual results. Each entry contains a summary, associated metadata, and a relevance score that indicates its relationship to the query.
6262

63-
By default, the returned `SearchResult` object will be encoded as JSON using JSON-B and the resulting JSON put into a `TextContent`. However, if instead we wanted each search result summary to be returned as its own `TextContent`, and set the priority annotation based on the relevance score, we can do that with a `ToolResponseEncoder`.
63+
By default, the `SearchResult` object that is returned is encoded as JSON by using JSON-B and placed into a `TextContent`. However, to return each search result summary as an individual `TextContent` and map the relevance score to a priority annotation, a `ToolResponseEncoder` is to be used
6464

65-
Create a CDI bean which implements the `ToolResponseEncoder` interface and implement:
65+
Create a CDI bean that implements the `ToolResponseEncoder` interface and implement:
6666

6767
* the `encode` method to create a `ToolResponse` from a `SearchResult`
6868
* the `supports` method to indicate that your encoder can be used for any `SearchResult`.
@@ -96,7 +96,7 @@ public class SearchResultEncoder implements ToolResponseEncoder<SearchResult> {
9696
}
9797
----
9898

99-
This encoder will be used for any tools in the application which return a `SearchResult`.
99+
This encoder is used for any tools in the application that return a `SearchResult`.
100100

101101
// DO NOT MODIFY THIS LINE. </GHA-BLOG-TOPIC>
102102

@@ -107,9 +107,9 @@ This encoder will be used for any tools in the application which return a `Searc
107107
[#requestid]
108108
== Access the request ID from a tool
109109

110-
Every request from an MCP client includes a Request ID which is unique to that session. Tools can now access that ID. This is mostly useful for logging or auditing.
110+
Each request from an MCP client includes a unique session-based Request ID, which is now accessible to tools and is useful for logging and auditing.
111111

112-
To access the ID, simply add a `RequestId` parameter to the tool method:
112+
To access the ID, add a `RequestId` parameter to the tool method:
113113

114114
[source,java]
115115
----

0 commit comments

Comments
 (0)