Result a tool callback may return, keyed by the tool's inferred output
type. Prefer the SDK's raw CallToolResult; interactive calls may
return an InputRequiredResult. Deprecated response helpers
(text, object, …) return the same envelope and remain accepted.
Without an outputSchema (TOutput = never) any CallToolResult is
accepted. With one, the result must carry structuredContent matching the
schema or set isError: true — mirroring the SDK's runtime rule, which
rejects results from schema'd tools that carry no structured content
unless isError is set.
The SDK auto-appends a JSON text block when structuredContent is a
non-object value and no type: "text" block is present; for object-shaped
payloads include the text serialization yourself:
Result a tool callback may return, keyed by the tool's inferred output type. Prefer the SDK's raw CallToolResult; interactive calls may return an InputRequiredResult. Deprecated response helpers (
text,object, …) return the same envelope and remain accepted.Without an
outputSchema(TOutput = never) anyCallToolResultis accepted. With one, the result must carrystructuredContentmatching the schema or setisError: true— mirroring the SDK's runtime rule, which rejects results from schema'd tools that carry no structured content unlessisErroris set.The SDK auto-appends a JSON text block when
structuredContentis a non-object value and notype: "text"block is present; for object-shaped payloads include the text serialization yourself: