public static class McpSchema.CallToolResult extends java.lang.Object implements McpSchema.Result
| 限定符和类型 | 类和说明 |
|---|---|
static class |
McpSchema.CallToolResult.Builder
Builder for
McpSchema.CallToolResult. |
| 构造器和说明 |
|---|
CallToolResult(java.util.List<McpSchema.Content> content,
java.lang.Boolean isError)
已过时。
use the builder instead.
|
CallToolResult(java.util.List<McpSchema.Content> content,
java.lang.Boolean isError,
java.util.Map<java.lang.String,java.lang.Object> structuredContent)
已过时。
use the builder instead.
|
CallToolResult(java.util.List<McpSchema.Content> content,
java.lang.Boolean isError,
java.lang.Object structuredContent,
java.util.Map<java.lang.String,java.lang.Object> meta) |
CallToolResult(java.lang.String content,
java.lang.Boolean isError)
已过时。
|
| 限定符和类型 | 方法和说明 |
|---|---|
static McpSchema.CallToolResult.Builder |
builder()
Creates a builder for
McpSchema.CallToolResult. |
java.util.List<McpSchema.Content> |
content() |
java.lang.Boolean |
isError() |
java.util.Map<java.lang.String,java.lang.Object> |
meta() |
java.lang.Object |
structuredContent() |
public CallToolResult(java.util.List<McpSchema.Content> content, java.lang.Boolean isError, java.lang.Object structuredContent, java.util.Map<java.lang.String,java.lang.Object> meta)
content - A list of content items representing the tool's output. Each item
can be text, an image, or an embedded resource.isError - If true, indicates that the tool execution failed and the content
contains error information. If false or absent, indicates successful execution.structuredContent - An optional JSON object that represents the structured
result of the tool call.meta - See specification for notes on _meta usage@Deprecated public CallToolResult(java.util.List<McpSchema.Content> content, java.lang.Boolean isError)
@Deprecated public CallToolResult(java.util.List<McpSchema.Content> content, java.lang.Boolean isError, java.util.Map<java.lang.String,java.lang.Object> structuredContent)
@Deprecated
public CallToolResult(java.lang.String content,
java.lang.Boolean isError)
McpSchema.CallToolResult with a string containing the
tool result.content - The content of the tool result. This will be mapped to a
one-sized list with a McpSchema.TextContent element.isError - If true, indicates that the tool execution failed and the
content contains error information. If false or absent, indicates successful
execution.public java.util.List<McpSchema.Content> content()
public java.lang.Boolean isError()
public java.lang.Object structuredContent()
public java.util.Map<java.lang.String,java.lang.Object> meta()
meta 在接口中 McpSchema.Metapublic static McpSchema.CallToolResult.Builder builder()
McpSchema.CallToolResult.