test_case_id: test_mermaid_no_extension
description: "Tests that the tool correctly adds a .png extension to a filename that lacks one."
tags: ["agent","tools","general_agent_tools"]
skip_intermediate_events: true

gateway_input:
  user_identity: "test_user@example.com"
  target_agent_name: "TestAgent"
  external_context:
    a2a_session_id: "session_mermaid_no_extension"
  prompt:
    parts:
      - text: "Create a simple graph and save it as diagram-no-extension"

llm_interactions:
  - static_response:
      choices:
        - message:
            role: "assistant"
            tool_calls:
              - id: "call_789"
                type: "function"
                function:
                  name: "mermaid_diagram_generator"
                  arguments: '{"mermaid_syntax": "graph LR; Start-->Stop;", "output_filename": "diagram-no-extension"}'
    expected_request:
      tools_present:
        - "mermaid_diagram_generator"
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: "I have created the graph and saved it as 'diagram-no-extension.png'."
    expected_request:
      expected_tool_responses_in_llm_messages:
        - tool_call_id_matches_prior_request_index: 0
          response_contains: "Mermaid diagram rendered and saved as artifact 'diagram-no-extension.png'"

expected_gateway_output:
  - type: status_update
    event_purpose: tool_invocation_start
    expected_tool_name: "mermaid_diagram_generator"
    expected_tool_args_contain:
      output_filename: "diagram-no-extension"

  - type: final_response
    content_parts:
      - type: text
        text_exact: "I have created the graph and saved it as 'diagram-no-extension.png'."

expected_artifacts:
  - filename: "diagram-no-extension.png"
    mime_type: "image/png"
    metadata_contains:
      description: "PNG image generated from Mermaid syntax. Original requested filename: diagram-no-extension"
