Create an error response.
Sets the isError flag to indicate the tool execution failed. Use this for user-friendly error messages.
The error message to return
Optional
Optional annotations and metadata
A CallToolResult with isError=true
// Simple errorreturn error('Container not found');// With annotationsreturn error('Permission denied', { annotations: { audience: ['user'] },}); Copy
// Simple errorreturn error('Container not found');// With annotationsreturn error('Permission denied', { annotations: { audience: ['user'] },});
Create an error response.
Sets the isError flag to indicate the tool execution failed. Use this for user-friendly error messages.