test_case_id: create_chart_invalid_config
description: "Tests failed chart creation due to an invalid JSON config."
tags: ["agent","tools","builtin_data_analysis_tools"]
skip_intermediate_events: true

gateway_input:
  request_text: "Create a chart from this invalid config."
  target_agent_name: "TestAgent"
  user_identity: "chart_tester@example.com"
  external_context:
    a2a_session_id: "chart_creation_session_invalid"

llm_interactions:
  - static_response:
      choices:
        - message:
            role: "assistant"
            tool_calls:
              - id: "call_chart_tool_invalid"
                type: "function"
                function:
                  name: "create_chart_from_plotly_config"
                  arguments: '{"config_content": "{\"data\": [{\"type\": \"invalid_chart_type\"}]}", "config_format": "json", "output_filename": "invalid_chart.png"}'
  - expected_request:
      expected_tool_responses_in_llm_messages:
        - tool_call_id_matches_prior_request_index: 0
          response_json_matches:
            status: "error"
    static_response:
      choices:
        - message:
            role: "assistant"
            content: "I'm sorry, I was unable to create the chart. The configuration appears to be invalid."

expected_gateway_output:
  - type: final_response
    task_state: "completed"

expected_artifacts: []
