public static class McpSchema.CallToolResult.Builder
extends java.lang.Object
McpSchema.CallToolResult.| 构造器和说明 |
|---|
Builder() |
| 限定符和类型 | 方法和说明 |
|---|---|
McpSchema.CallToolResult.Builder |
addContent(McpSchema.Content contentItem)
Adds a content item to the tool result.
|
McpSchema.CallToolResult.Builder |
addTextContent(java.lang.String text)
Adds a text content item to the tool result.
|
McpSchema.CallToolResult |
build()
Builds a new
McpSchema.CallToolResult instance. |
McpSchema.CallToolResult.Builder |
content(java.util.List<McpSchema.Content> content)
Sets the content list for the tool result.
|
McpSchema.CallToolResult.Builder |
isError(java.lang.Boolean isError)
Sets whether the tool execution resulted in an error.
|
McpSchema.CallToolResult.Builder |
meta(java.util.Map<java.lang.String,java.lang.Object> meta)
Sets the metadata for the tool result.
|
McpSchema.CallToolResult.Builder |
structuredContent(McpJsonMapper jsonMapper,
java.lang.String structuredContent) |
McpSchema.CallToolResult.Builder |
structuredContent(java.lang.Object structuredContent) |
McpSchema.CallToolResult.Builder |
textContent(java.util.List<java.lang.String> textContent)
Sets the text content for the tool result.
|
public McpSchema.CallToolResult.Builder content(java.util.List<McpSchema.Content> content)
content - the content listpublic McpSchema.CallToolResult.Builder structuredContent(java.lang.Object structuredContent)
public McpSchema.CallToolResult.Builder structuredContent(McpJsonMapper jsonMapper, java.lang.String structuredContent)
public McpSchema.CallToolResult.Builder textContent(java.util.List<java.lang.String> textContent)
textContent - the text contentpublic McpSchema.CallToolResult.Builder addContent(McpSchema.Content contentItem)
contentItem - the content item to addpublic McpSchema.CallToolResult.Builder addTextContent(java.lang.String text)
text - the text contentpublic McpSchema.CallToolResult.Builder isError(java.lang.Boolean isError)
isError - true if the tool execution failed, false otherwisepublic McpSchema.CallToolResult.Builder meta(java.util.Map<java.lang.String,java.lang.Object> meta)
meta - metadatapublic McpSchema.CallToolResult build()
McpSchema.CallToolResult instance.