– UNSUPPORTED

vercel-ai 7.0.153

truncation.structured-output-forced-tool · anthropic

Back to results · Scenario

Requirements

IdLevelStatusEvidence

Notes

  • On claude-haiku-4-5 (and claude-sonnet-5-5) the default structured output is native output_config.format, not a forced tool. The documented jsonTool opt-in forces a tool named json, so no supported path sends the fixture's forced structured_output call. (https://ai-sdk.dev/providers/ai-sdk-providers/anthropic#structured-outputs)

What the provider sent

Finish
length
Raw finish
max_tokens
Text
null
Tool calls
[
  {
    "arguments": {
      "islands": [
        {
          "name": "Κρήτη"
        }
      ]
    },
    "arguments_parsed_ok": true,
    "arguments_raw": "{\"islands\":[{\"name\":\"Κρήτη\"}]}",
    "id": "toolu_01A09q90qw90lq917835lq9",
    "name": "structured_output"
  }
]
Usage
{
  "alternatives": {},
  "cached_input": null,
  "input": 25,
  "output": 24,
  "raw": {
    "input_tokens": 25,
    "output_tokens": 24
  },
  "reasoning": null,
  "total": 49
}
Stream completed
null
Error
null
Wire excerpt
status: 200
content-type: application/json
body (json):
{
  "id": "msg_01Aq9w938a90dw8q",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "tool_use",
      "id": "toolu_01A09q90qw90lq917835lq9",
      "name": "structured_output",
      "input": {
        "islands": [
          {
            "name": "Κρήτη"
          }
        ]
      }
    }
  ],
  "model": "claude-haiku-4-5",
  "stop_reason": "max_tokens",
  "stop_sequence": null,
  "stop_details": null,
  "usage": {
    "input_tokens": 25,
    "output_tokens": 24
  }
}

What the library reported

Outcome
unsupported
Finish
{
  "raw": null,
  "source": null,
  "surface": "absent",
  "value": null
}
Text
Value
null
Surface
absent
Tool calls
[]
Usage
{
  "cached_input": null,
  "input": null,
  "output": null,
  "reasoning": null,
  "surface": {
    "cached_input": "absent",
    "input": "absent",
    "output": "absent",
    "reasoning": "absent",
    "total": "absent"
  },
  "total": null
}
Stream
{
  "chunks_seen": null,
  "completed": null,
  "used": false
}
Error
null
Unsupported reason
On claude-haiku-4-5 (and claude-sonnet-5-5) the default structured output is native output_config.format, not a forced tool. The documented jsonTool opt-in forces a tool named json, so no supported path sends the fixture's forced structured_output call. https://ai-sdk.dev/providers/ai-sdk-providers/anthropic#structured-outputs
Full observation JSON
{
  "elapsed_ms": 6.653661999999997,
  "error": null,
  "finish": {
    "raw": null,
    "source": null,
    "surface": "absent",
    "value": null
  },
  "format": "wiretruth.observation/v1",
  "library": {
    "api": "generateText",
    "language": "javascript",
    "name": "vercel-ai",
    "version": "7.0.153"
  },
  "notes": [],
  "outcome": "unsupported",
  "stream": {
    "chunks_seen": null,
    "completed": null,
    "used": false
  },
  "structured": {
    "attempted": false,
    "returned_as_success": false,
    "value": null
  },
  "text": {
    "surface": "absent",
    "value": null
  },
  "tool_calls": [],
  "unsupported_reason": "On claude-haiku-4-5 (and claude-sonnet-5-5) the default structured output is native output_config.format, not a forced tool. The documented jsonTool opt-in forces a tool named json, so no supported path sends the fixture's forced structured_output call. https://ai-sdk.dev/providers/ai-sdk-providers/anthropic#structured-outputs",
  "usage": {
    "cached_input": null,
    "input": null,
    "output": null,
    "reasoning": null,
    "surface": {
      "cached_input": "absent",
      "input": "absent",
      "output": "absent",
      "reasoning": "absent",
      "total": "absent"
    },
    "total": null
  }
}

Fixture

documented anthropic/truncation.structured-output-forced-tool

ProvenanceValue
Sourcehttps://platform.claude.com/docs/en/agents-and-tools/tool-use/define-tools#forcing-tool-use
NotesDocumented shapes, not a recording. Message envelope follows handling-stop-reasons; tool_use object and forced tool choice follow define-tools. Model changed to claude-haiku-4-5; message ID follows the handle-tool-calls example. Scenario data and token counts are filled in, not measured. ASSUMED truncation: input stays an object as documented, but the island is missing its required sea. The docs do not show this exact forced Haiku truncation. No thinking block: forced tool use skips thinking. The call override supplies explicit tools and named tool_choice while output_schema retains the structured intent; no native output_config.format is sent.

Reproduce

wiretruth serve anthropic/truncation.structured-output-forced-tool

Plain-library snippet from the shim manifest.

createAnthropic({ baseURL: WIRETRUTH_BASE_URL_ANTHROPIC + '/v1', apiKey })(model)

Upstream

No matching upstream report.

History

VersionGrade
7.0.153– UNSUPPORTED
7.0.146– UNSUPPORTED
7.0.142– UNSUPPORTED