@@ -685,66 +685,31 @@ export interface ListToolsResult extends PaginatedResult {
685685
686686/**
687687 * The server's response to a tool call.
688- *
689- * Any errors that originate from the tool SHOULD be reported inside the result
690- * object, with `isError` set to true, _not_ as an MCP protocol-level error
691- * response. Otherwise, the LLM would not be able to see that an error occurred
692- * and self-correct.
693- *
694- * However, any errors in _finding_ the tool, an error indicating that the
695- * server does not support tool calls, or any other exceptional conditions,
696- * should be reported as an MCP error response.
697- */
698- export type CallToolResult =
699- | CallToolUnstructuredResult
700- | CallToolStructuredResult ;
701-
702- /**
703- * Tool result for tools that do not declare an outputSchema.
704688 */
705- export interface CallToolUnstructuredResult extends Result {
689+ export interface CallToolResult extends Result {
706690 /**
707- * A list of content objects that represent the result of the tool call.
708- *
709- * If the Tool does not define an outputSchema, this field MUST be present in the result.
691+ * A list of content objects that represent the unstructured result of the tool call.
710692 */
711693 content : ContentBlock [ ] ;
712694
713695 /**
714- * Structured output must not be provided in an unstructured tool result .
696+ * An optional JSON object that represents the structured result of the tool call .
715697 */
716- structuredContent : never ;
698+ structuredContent ?: { [ key : string ] : unknown } ;
717699
718700 /**
719701 * Whether the tool call ended in an error.
720702 *
721703 * If not set, this is assumed to be false (the call was successful).
722- */
723- isError ?: boolean ;
724- }
725-
726- /**
727- * Tool result for tools that do declare an outputSchema.
728- */
729- export interface CallToolStructuredResult extends Result {
730- /**
731- * An object containing structured tool output.
732704 *
733- * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
734- */
735- structuredContent : { [ key : string ] : unknown } ;
736-
737- /**
738- * If the Tool defines an outputSchema, this field MAY be present in the result.
739- * Tools should use this field to provide compatibility with older clients that do not support structured content.
740- * Clients that support structured content should ignore this field.
741- */
742- content ?: ContentBlock [ ] ;
743-
744- /**
745- * Whether the tool call ended in an error.
705+ * Any errors that originate from the tool SHOULD be reported inside the result
706+ * object, with `isError` set to true, _not_ as an MCP protocol-level error
707+ * response. Otherwise, the LLM would not be able to see that an error occurred
708+ * and self-correct.
746709 *
747- * If not set, this is assumed to be false (the call was successful).
710+ * However, any errors in _finding_ the tool, an error indicating that the
711+ * server does not support tool calls, or any other exceptional conditions,
712+ * should be reported as an MCP error response.
748713 */
749714 isError ?: boolean ;
750715}
0 commit comments