public static class McpSchema.CallToolResult.Builder extends Object
McpSchema.CallToolResult.| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
McpSchema.CallToolResult.Builder |
addContent(McpSchema.Content contentItem)
Adds a content item to the tool result.
|
McpSchema.CallToolResult.Builder |
addTextContent(String text)
Adds a text content item to the tool result.
|
McpSchema.CallToolResult |
build()
Builds a new
McpSchema.CallToolResult instance. |
McpSchema.CallToolResult.Builder |
content(List<McpSchema.Content> content)
Sets the content list for the tool result.
|
McpSchema.CallToolResult.Builder |
isError(Boolean isError)
Sets whether the tool execution resulted in an error.
|
McpSchema.CallToolResult.Builder |
meta(Map<String,Object> meta)
Sets the metadata for the tool result.
|
McpSchema.CallToolResult.Builder |
structuredContent(Map<String,Object> structuredContent) |
McpSchema.CallToolResult.Builder |
structuredContent(String structuredContent) |
McpSchema.CallToolResult.Builder |
textContent(List<String> textContent)
Sets the text content for the tool result.
|
public McpSchema.CallToolResult.Builder content(List<McpSchema.Content> content)
content - the content listpublic McpSchema.CallToolResult.Builder structuredContent(Map<String,Object> structuredContent)
public McpSchema.CallToolResult.Builder structuredContent(String structuredContent)
public McpSchema.CallToolResult.Builder textContent(List<String> textContent)
textContent - the text contentpublic McpSchema.CallToolResult.Builder addContent(McpSchema.Content contentItem)
contentItem - the content item to addpublic McpSchema.CallToolResult.Builder addTextContent(String text)
text - the text contentpublic McpSchema.CallToolResult.Builder isError(Boolean isError)
isError - true if the tool execution failed, false otherwisepublic McpSchema.CallToolResult.Builder meta(Map<String,Object> meta)
meta - metadatapublic McpSchema.CallToolResult build()
McpSchema.CallToolResult instance.Copyright © 2025. All rights reserved.