Skip to content

Inspector warning encourages JSON-stringified content when structuredContent is present #1089

@krubenok

Description

@krubenok

The Inspector UI currently emits a warning No text block matches structured content when a tool returns structuredContent (and the tool has an outputSchema) but none of the content text blocks parse as JSON equal to structuredContent.

This encourages server implementers to make CallToolResult.content a JSON-stringified copy of structuredContent, but the intended usage is that content is model-facing and may be a concise, human-readable summary (semantically equivalent without being a verbatim JSON serialization).

Where this happens:

  • client/src/components/ToolResults.tsx: checkContentCompatibility() attempts JSON.parse(textBlock.text) and compares JSON.stringify(parsed) === JSON.stringify(structuredContent).
  • Warning message shown when no match is found: No text block matches structured content.

Repro:

  1. Define a tool with an outputSchema.
  2. Return a result with:
    • structuredContent: a valid object matching outputSchema
    • content: a text summary that is not JSON (e.g. "Temperature is 25C")
  3. Inspector shows the warning.

Expected:

  • Inspector should not warn just because content is not JSON-identical to structuredContent.
  • If we keep any indicator, it should be informational (e.g. "Could not automatically verify semantic equivalence"), or only show a positive signal when a JSON match exists.

Context:

Image

Proposed change:

  • Remove the negative warning state for this check, or downgrade it to neutral/info.
  • Optionally keep a positive hint when a JSON text block exactly matches structuredContent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions