def METHOD_NAME(parse_mock, execute_mock, get_completed_tasks_mock, complete_task_mock):
    # Arrange
    agent_execution_id = 11
    agent_config = {"agent_id": 22, "permission_type": "unrestricted"}
    assistant_reply = '{"tool": {"name": "someAction", "args": ["arg1", "arg2"]}}'
    parse_mock.return_value = AgentGPTAction(name="someAction", args=["arg1", "arg2"])
    # Define what the mock response status should be
    execute_mock.return_value = Mock(status='PENDING', is_permission_required=False)
    handler = ToolOutputHandler(agent_execution_id, agent_config, [],None)
    # Mock session
    session_mock = MagicMock()
    session_mock.query.return_value.filter.return_value.first.return_value = Mock()
    handler._check_for_completion = Mock(return_value=Mock(status='PENDING', is_permission_required=False))
    handler.handle_tool_response = Mock(return_value=Mock(status='PENDING', is_permission_required=False))
    # Act
    response = handler.handle(session_mock, assistant_reply)
    # Assert
    assert response.status == "PENDING"
    parse_mock.assert_called_with(assistant_reply)
    assert session_mock.add.call_count == 2