Prefer raw CallToolResult, ReadResourceResult, or GetPromptResult returns. These helpers remain for upgrade compatibility and map to the official wire envelopes.
Create a plain-text tool result.
Text to return.
Tool result with a single text content block.
Prefer { content: [{ type: "text", text: content }] }.
{ content: [{ type: "text", text: content }] }
// Preferred:return { content: [{ type: "text", text: `Hello, ${name}!` }] };// Deprecated:return text(`Hello, ${name}!`); Copy
// Preferred:return { content: [{ type: "text", text: `Hello, ${name}!` }] };// Deprecated:return text(`Hello, ${name}!`);
Deprecated
Prefer raw CallToolResult, ReadResourceResult, or GetPromptResult returns. These helpers remain for upgrade compatibility and map to the official wire envelopes.