We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3dc35c commit 205a459Copy full SHA for 205a459
mcp/utils.go
@@ -252,6 +252,19 @@ func NewToolResultResource(
252
}
253
254
255
+// NewToolResultError creates a new CallToolResult with an error message.
256
+// Any errors that originate from the tool SHOULD be reported inside the result object.
257
+func NewToolResultError(text string) *CallToolResult {
258
+ return &CallToolResult{
259
+ Content: []Content{
260
+ TextContent{
261
+ Type: "text",
262
+ Text: text,
263
+ },
264
265
+ }
266
+}
267
+
268
// NewListResourcesResult creates a new ListResourcesResult
269
func NewListResourcesResult(
270
resources []Resource,
0 commit comments